warning -> notice

This commit is contained in:
Ludy87 2025-08-19 17:18:47 +02:00
parent 673ce5f611
commit 4a7cc7e031
No known key found for this signature in database
GPG Key ID: 92696155E0220F94
3 changed files with 800 additions and 782 deletions

View File

@ -110,6 +110,24 @@ describe('matching tests', () => {
expect(match.backend).toEqual([])
})
test('does not match unrelated files with complex filter combinations', () => {
const yaml = `
backend:
- '**/*backend*'
- 'src/backend/**'
- 'src/shared/**'
- '**/Cargo*'
- '**/*rust*'
- 'Dockerfile'
- 'docker/**'
- '!src/frontend/**'
`
const filter = new Filter(yaml)
const files = modified(['vitest.setup.ts'])
const match = filter.match(files)
expect(match.backend).toEqual([])
})
test('negated pattern excludes matching files', () => {
const yaml = `
backend:

1558
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -79,7 +79,7 @@ async function getChangedFiles(token: string, base: string, ref: string, initial
// This is the simplest case as we don't need to fetch more commits or evaluate current/before refs
if (base === git.HEAD) {
if (ref) {
core.warning(`'ref' input parameter is ignored when 'base' is set to HEAD`)
core.notice(`'ref' input parameter is ignored when 'base' is set to HEAD`)
}
return await git.getChangesOnHead()
}
@ -87,10 +87,10 @@ async function getChangedFiles(token: string, base: string, ref: string, initial
const prEvents = ['pull_request', 'pull_request_review', 'pull_request_review_comment', 'pull_request_target']
if (prEvents.includes(github.context.eventName)) {
if (ref) {
core.warning(`'ref' input parameter is ignored when 'base' is set to HEAD`)
core.notice(`'ref' input parameter is ignored when 'base' is set to HEAD`)
}
if (base) {
core.warning(`'base' input parameter is ignored when action is triggered by pull request event`)
core.notice(`'base' input parameter is ignored when action is triggered by pull request event`)
}
const pr = github.context.payload.pull_request as PullRequestEvent
if (token) {