Skip to content

Commit

Permalink
fix: bug with files ignore yaml patterns not filtering the list of fi…
Browse files Browse the repository at this point in the history
…les (#2304)

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
jackton1 and actions-user authored Oct 2, 2024
1 parent 641e22a commit d0cf164
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,24 @@ jobs:
shell:
bash

- name: Run changed-files with files_yaml, files_ignore_yaml
id: changed-files-ignore
uses: ./
with:
files_yaml: |
test:
- test/**.txt
- test/**.md
files_ignore_yaml: |
test:
- test/test.txt
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-ignore.outputs) }}"
shell:
bash

- name: Run changed-files with files_yaml, json and write_output_files
id: changed-files-json-write-output-files
uses: ./
Expand Down
4 changes: 4 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,10 @@ export const getYamlFilePatterns = async ({
)
}
}
filePatterns = {
...filePatterns,
...newIgnoreFilePatterns
}
}

if (inputs.filesIgnoreYamlFromSourceFile) {
Expand Down
1 change: 1 addition & 0 deletions test/new.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test markdown file
2 changes: 1 addition & 1 deletion test/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This is a test file.
This is a test file...

0 comments on commit d0cf164

Please sign in to comment.