Skip to content

Commit

Permalink
feat: add option to exclude submodules when detecting changes (#2047)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
jackton1 and actions-user authored Apr 17, 2024
1 parent 23a4490 commit e052d30
Show file tree
Hide file tree
Showing 14 changed files with 176 additions and 115 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,27 @@ jobs:
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash

- name: Run changed-files excluding submodule
id: changed-files-exclude-submodule
uses: ./
with:
base_sha: "85bd869"
sha: "adde7bb"
fetch_depth: 60000
exclude_submodules: true

- name: Verify no added files
if: steps.changed-files-exclude-submodule.outputs.added_files != ''
run: |
echo "Expected: ('') got ${{ steps.changed-files-exclude-submodule.outputs.added_files }}"
exit 1
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-exclude-submodule.outputs) }}"
shell:
bash
test-yaml:
name: Test changed-files with yaml
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ inputs:
description: "Output changed files in a format that can be used for matrix jobs. Alias for setting inputs `json` to `true` and `escape_json` to `false`."
required: false
default: "false"
exclude_submodules:
description: "Exclude changes to submodules."
required: false
default: "false"

outputs:
added_files:
Expand Down
53 changes: 32 additions & 21 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.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
"package": "ncc build lib/main.js --source-map --license licenses.txt",
"test": "jest --coverage",
"update-snapshot": "jest -u",
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
},
"repository": {
Expand Down
Loading

0 comments on commit e052d30

Please sign in to comment.