mirror of
https://github.com/dorny/paths-filter.git
synced 2026-03-10 16:34:28 +00:00
warning -> notice
This commit is contained in:
parent
673ce5f611
commit
4a7cc7e031
@ -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
1558
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user