mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 03:47:20 +00:00
feat: Add support for excluding files via files-ignore input (#369)
This commit is contained in:
parent
690deb84ea
commit
acb1d7db82
4 changed files with 27 additions and 16 deletions
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
|
@ -10,14 +10,6 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cleanup-runs:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: "!startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, 'main')"
|
|
||||||
steps:
|
|
||||||
- uses: rokroskar/workflow-run-cleanup-action@v0.3.3
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
name: Run shellcheck
|
name: Run shellcheck
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -231,7 +223,8 @@ jobs:
|
||||||
.github/workflows/test.yml
|
.github/workflows/test.yml
|
||||||
action.yml
|
action.yml
|
||||||
**/test.txt
|
**/test.txt
|
||||||
!test/test/test.txt
|
files_ignore: |
|
||||||
|
test/test/test.txt
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
|
||||||
|
|
|
@ -128,10 +128,13 @@ Support this project with a :star:
|
||||||
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
| token | `string` | `false` | `${{ github.token }}` | [GITHUB\_TOKEN](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#using-the-github_token-in-a-workflow) <br /> or a repo scoped <br /> [Personal Access Token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) |
|
||||||
| separator | `string` | `true` | `' '` | Output string separator |
|
| separator | `string` | `true` | `' '` | Output string separator |
|
||||||
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
| files | `string` OR `string[]` | `false` | | Check for changes <br> using only these <br> list of file(s) <br> (Defaults to the <br> entire repo) |
|
||||||
| files-separator | string | false | `'\n'` | Separator used to split the<br>files input |
|
| files_separator | string | false | `'\n'` | Separator used to split the<br>`files` input |
|
||||||
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
| files\_from\_source\_file | `string` | `false` | | Source file(s) <br> used to populate <br> the `files` input |
|
||||||
|
| files_ignore | string | false | | Ignore changes to these file(s) |
|
||||||
|
| files_ignore_separator | string | false | `'\n'` | Separator used to split the <br>`files-ignore` input |
|
||||||
|
| files_ignore\_from\_source\_file | `string` | `false` | | Source file(s) <br> used to populate <br> the `files_ignore` input |
|
||||||
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
| sha | `string` | `true` | `${{ github.sha }}` | Specify a different <br> commit SHA <br> used for <br> comparing changes |
|
||||||
| files\_from\_source\_file | `string` | `false` | | Source file <br> used to populate <br> the files input |
|
| base\_sha | `string` | `false` | | Specify a different <br> base commit SHA <br> used for <br> comparing changes |
|
||||||
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
| path | `string` | `false` | | Relative path under <br> `GITHUB_WORKSPACE` <br> to the repository |
|
||||||
| since\_last\_remote\_commit | `string` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the previous commit). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
| since\_last\_remote\_commit | `string` | `false` | `false` | Use the last commit on the remote <br> branch as the `base_sha` <br> (Defaults to the previous commit). <br /> NOTE: This requires <br /> `fetch-depth: 0` <br /> with `actions/checkout@v2` |
|
||||||
|
|
||||||
|
|
21
action.yml
21
action.yml
|
@ -12,17 +12,29 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
default: " "
|
default: " "
|
||||||
files_from_source_file:
|
files_from_source_file:
|
||||||
description: 'Source file to populate the files input'
|
description: 'Source file(s) to populate the files input'
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
files:
|
files:
|
||||||
description: 'Check for changes using only this list of files (Defaults to the entire repo)'
|
description: 'Check for changes using only this list of files (Defaults to the entire repo)'
|
||||||
required: false
|
required: false
|
||||||
default: ""
|
default: ""
|
||||||
files-separator:
|
files_separator:
|
||||||
description: 'Separator used to split the files input'
|
description: 'Separator used to split the files input'
|
||||||
default: "\n"
|
default: "\n"
|
||||||
required: false
|
required: false
|
||||||
|
files_ignore:
|
||||||
|
description: 'Ignore changes to this list of files'
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
files_ignore_separator:
|
||||||
|
description: 'Separator used to split the files-ignore input'
|
||||||
|
default: "\n"
|
||||||
|
required: false
|
||||||
|
files_ignore_from_source_file:
|
||||||
|
description: 'Source file(s) to populate the files-ignore input'
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
sha:
|
sha:
|
||||||
description: 'Specify a current commit SHA used for comparing changes'
|
description: 'Specify a current commit SHA used for comparing changes'
|
||||||
required: true
|
required: true
|
||||||
|
@ -136,8 +148,11 @@ runs:
|
||||||
id: glob
|
id: glob
|
||||||
with:
|
with:
|
||||||
files: ${{ inputs.files }}
|
files: ${{ inputs.files }}
|
||||||
files-separator: ${{ inputs.files-separator }}
|
files-separator: ${{ inputs.files_separator }}
|
||||||
|
excluded-files: ${{ inputs.files_ignore }}
|
||||||
|
excluded-files-separator: ${{ inputs.files_ignore_separator }}
|
||||||
files-from-source-file: ${{ inputs.files_from_source_file }}
|
files-from-source-file: ${{ inputs.files_from_source_file }}
|
||||||
|
excluded-files-from-source-file: ${{ inputs.files_ignore_from_source_file}}
|
||||||
working-directory: ${{ inputs.path }}
|
working-directory: ${{ inputs.path }}
|
||||||
base-sha: ${{ steps.changed-files-diff-sha.outputs.previous_sha }}
|
base-sha: ${{ steps.changed-files-diff-sha.outputs.previous_sha }}
|
||||||
sha: ${{ steps.changed-files-diff-sha.outputs.current_sha }}
|
sha: ${{ steps.changed-files-diff-sha.outputs.current_sha }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
This is a test file
|
This is a test file.
|
||||||
|
|
Loading…
Reference in a new issue