Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0874344d6e | ||
|
|
9f8300f8b4 | ||
|
|
a06b9e80ae | ||
|
|
4c5f5d698f | ||
|
|
07c64e5618 | ||
|
|
5bd333239b | ||
|
|
831e892562 | ||
|
|
e052d30e1c | ||
|
|
23a449039c | ||
|
|
60e2739e15 | ||
|
|
0f319d7425 | ||
|
|
d477ae513d | ||
|
|
5891cbdfd5 | ||
|
|
c9eaa5c000 | ||
|
|
fd91508dbb | ||
|
|
e8a7e82269 | ||
|
|
159b05372c | ||
|
|
635f118699 | ||
|
|
634b61511e | ||
|
|
77fcf43160 | ||
|
|
5f084a52a4 | ||
|
|
ff2cb1b4f2 | ||
|
|
5d5da31340 | ||
|
|
29bc0d3fd9 | ||
|
|
c9f9d5784e | ||
|
|
a4fba0109c | ||
|
|
8a6546164a | ||
|
|
bad2eb6859 | ||
|
|
b2dbd4264a | ||
|
|
57d40e662d | ||
|
|
185549c022 | ||
|
|
f853fd0592 | ||
|
|
cd3c6e6bbd | ||
|
|
e5ce44a301 | ||
|
|
ccdcd17ffd | ||
|
|
e4b8dafc5d | ||
|
|
2d756ea4c5 | ||
|
|
ce497c39e9 | ||
|
|
2d21bbb405 | ||
|
|
90941b398f | ||
|
|
2ca8dc42f6 | ||
|
|
ee096d679e | ||
|
|
4621617d4b | ||
|
|
4bbd49b998 | ||
|
|
c6557ed000 | ||
|
|
f0e7702ccc | ||
|
|
6354e6c542 | ||
|
|
117616472f | ||
|
|
4ff79362e5 | ||
|
|
0713a11242 | ||
|
|
064742427d | ||
|
|
efe5e6c7a4 | ||
|
|
01e9662a12 | ||
|
|
20576b4b9e | ||
|
|
077b23f6a6 | ||
|
|
02768050b1 | ||
|
|
427adf47f0 | ||
|
|
5c6aa49478 | ||
|
|
aa0b62a2d0 | ||
|
|
0320702dd5 | ||
|
|
38903688b4 | ||
|
|
98a74d2cd6 | ||
|
|
068000d9c6 | ||
|
|
490ac3999e | ||
|
|
2859a60726 | ||
|
|
d03038e4e4 |
2
.github/workflows/sync-release-version.yml
vendored
2
.github/workflows/sync-release-version.yml
vendored
@@ -37,7 +37,7 @@ jobs:
|
|||||||
- name: Run git-cliff
|
- name: Run git-cliff
|
||||||
uses: tj-actions/git-cliff@v1
|
uses: tj-actions/git-cliff@v1
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v6.0.2
|
uses: peter-evans/create-pull-request@v6.0.4
|
||||||
with:
|
with:
|
||||||
base: "main"
|
base: "main"
|
||||||
labels: "merge when passing"
|
labels: "merge when passing"
|
||||||
|
|||||||
60
.github/workflows/test.yml
vendored
60
.github/workflows/test.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
|||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
- name: Run eslint on changed files
|
- name: Run eslint on changed files
|
||||||
uses: tj-actions/eslint-changed-files@v23
|
uses: tj-actions/eslint-changed-files@v24
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.PAT_TOKEN }}
|
token: ${{ secrets.PAT_TOKEN }}
|
||||||
@@ -682,6 +682,27 @@ jobs:
|
|||||||
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
echo "${{ toJSON(steps.changed-files.outputs) }}"
|
||||||
shell:
|
shell:
|
||||||
bash
|
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:
|
test-yaml:
|
||||||
name: Test changed-files with yaml
|
name: Test changed-files with yaml
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -988,8 +1009,11 @@ jobs:
|
|||||||
bash
|
bash
|
||||||
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
|
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
|
||||||
name: Test dir names deleted files include only deleted dirs
|
name: Test dir names deleted files include only deleted dirs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.platform }}
|
||||||
needs: build
|
needs: build
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
if: needs.build.outputs.files_changed != 'true'
|
if: needs.build.outputs.files_changed != 'true'
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -997,7 +1021,7 @@ jobs:
|
|||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
@@ -1009,6 +1033,7 @@ jobs:
|
|||||||
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
||||||
dir_names: true
|
dir_names: true
|
||||||
dir_names_deleted_files_include_only_deleted_dirs: true
|
dir_names_deleted_files_include_only_deleted_dirs: true
|
||||||
|
fetch_depth: 60000
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
|
||||||
@@ -1028,6 +1053,35 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with dir_names and dir_names_deleted_files_include_only_deleted_dirs with the test directory deleted returns posix path separator
|
||||||
|
id: changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
base_sha: a52f8621d26d5d9f54b80f74bda2d9eedff94693
|
||||||
|
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
|
||||||
|
dir_names: true
|
||||||
|
dir_names_deleted_files_include_only_deleted_dirs: true
|
||||||
|
use_posix_path_separator: true
|
||||||
|
fetch_depth: 60000
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check deleted_files output on non windows platform
|
||||||
|
if: steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files != 'test/test3' && runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check deleted_files output on windows platform
|
||||||
|
if: "!contains(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files, 'test/test3') && runner.os == 'Windows'"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected (test/test3) got (${{ steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory-posix-path-separator.outputs.deleted_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
|
||||||
test-since-last-remote-commit:
|
test-since-last-remote-commit:
|
||||||
name: Test changed-files since last remote commit
|
name: Test changed-files since last remote commit
|
||||||
|
|||||||
191
HISTORY.md
191
HISTORY.md
@@ -1,5 +1,196 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# [44.2.0](https://github.com/tj-actions/changed-files/compare/v44.1.0...v44.2.0) - (2024-04-18)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support for specifying the max number for retries to fetch missing history ([#2052](https://github.com/tj-actions/changed-files/issues/2052)) ([07c64e5](https://github.com/tj-actions/changed-files/commit/07c64e56185e44568aa942ce23164b22828747eb)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#2053](https://github.com/tj-actions/changed-files/issues/2053))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([4c5f5d6](https://github.com/tj-actions/changed-files/commit/4c5f5d698fbf2d763d5f13815ac7c2ccbef1ff7f)) - (tj-actions[bot])
|
||||||
|
- Updated README.md ([#2049](https://github.com/tj-actions/changed-files/issues/2049))
|
||||||
|
|
||||||
|
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([831e892](https://github.com/tj-actions/changed-files/commit/831e892562944fa1fa9356c6b6e231553148f7bc)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v44.1.0 ([#2050](https://github.com/tj-actions/changed-files/issues/2050))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([5bd3332](https://github.com/tj-actions/changed-files/commit/5bd333239b5f6fc69dcea71aafdd8c9da21aa0a2)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [44.1.0](https://github.com/tj-actions/changed-files/compare/v44.0.1...v44.1.0) - (2024-04-17)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add option to exclude submodules when detecting changes ([#2047](https://github.com/tj-actions/changed-files/issues/2047)) ([e052d30](https://github.com/tj-actions/changed-files/commit/e052d30e1c0bdf27cd806b01ca3b393f47b50c62)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 16 -->➕ Add
|
||||||
|
|
||||||
|
- Added missing changes and modified dist assets.
|
||||||
|
([d477ae5](https://github.com/tj-actions/changed-files/commit/d477ae513d5b52384bbf032bcc395a548501f3fc)) - (GitHub Action)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update peter-evans/create-pull-request action to v6.0.4 ([23a4490](https://github.com/tj-actions/changed-files/commit/23a449039c6fee9756073fb578b2659e524ea07a)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v7.7.0 ([60e2739](https://github.com/tj-actions/changed-files/commit/60e2739e15ad6e8a2d5a3b2c8c2d420894687405)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([0f319d7](https://github.com/tj-actions/changed-files/commit/0f319d742554833419bdc95d68ecb50ccebcd39d)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([5891cbd](https://github.com/tj-actions/changed-files/commit/5891cbdfd5eb99762cc467c50ed8b39f26cc9d74)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/micromatch to v4.0.7 ([c9eaa5c](https://github.com/tj-actions/changed-files/commit/c9eaa5c000b860baef243fabe5562a694dc58c0e)) - (renovate[bot])
|
||||||
|
- **deps:** Update peter-evans/create-pull-request action to v6.0.3 ([fd91508](https://github.com/tj-actions/changed-files/commit/fd91508dbb9a3cf89ed4b32684b6eeb925e0e157)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency typescript to v5.4.5 ([e8a7e82](https://github.com/tj-actions/changed-files/commit/e8a7e822693e723321608f9be7209c66c3f74860)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v44.0.1 ([#2037](https://github.com/tj-actions/changed-files/issues/2037))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([159b053](https://github.com/tj-actions/changed-files/commit/159b05372c2d806218e9370a3e877b6d9db80737)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [44.0.1](https://github.com/tj-actions/changed-files/compare/v44.0.0...v44.0.1) - (2024-04-09)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- **deps:** Update dependency @octokit/rest to v20.1.0 ([57d40e6](https://github.com/tj-actions/changed-files/commit/57d40e662d530daae769897d18bded8d3cf4263b)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 16 -->➕ Add
|
||||||
|
|
||||||
|
- Added missing changes and modified dist assets.
|
||||||
|
([5f084a5](https://github.com/tj-actions/changed-files/commit/5f084a52a4aa792443ce2bbb4a91daa956a83c4f)) - (GitHub Action)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.7 ([635f118](https://github.com/tj-actions/changed-files/commit/635f118699dd888d737c15018cd30aff2e0274f8)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.6 ([634b615](https://github.com/tj-actions/changed-files/commit/634b61511ee053fabd2cfaaf72201ee2aba54a71)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v7.6.0 ([77fcf43](https://github.com/tj-actions/changed-files/commit/77fcf43160285ab257bfa4b0ef824674404bb585)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([ff2cb1b](https://github.com/tj-actions/changed-files/commit/ff2cb1b4f2d5b477f5e0720e406ebb59af963a5b)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint-plugin-jest to v28.2.0 ([5d5da31](https://github.com/tj-actions/changed-files/commit/5d5da31340cc6c5ce75e99ca8e5436aeda1c111f)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint-plugin-jest to v28.1.1 ([29bc0d3](https://github.com/tj-actions/changed-files/commit/29bc0d3fd93da8b4eae1bc7568d193b2092baf9c)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency eslint-plugin-jest to v28 ([#2030](https://github.com/tj-actions/changed-files/issues/2030)) ([c9f9d57](https://github.com/tj-actions/changed-files/commit/c9f9d5784e44a3f04e2995c42e6ca15f7c41374b)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.5 ([a4fba01](https://github.com/tj-actions/changed-files/commit/a4fba0109cdb1460d2d6a345cbe68883a3efec47)) - (renovate[bot])
|
||||||
|
- **deps:** Bump undici from 5.28.3 to 5.28.4 ([#2026](https://github.com/tj-actions/changed-files/issues/2026)) ([8a65461](https://github.com/tj-actions/changed-files/commit/8a6546164ab50b552bf37a71eb624e115731c3ee)) - (dependabot[bot])
|
||||||
|
- **deps:** Update dependency typescript to v5.4.4 ([bad2eb6](https://github.com/tj-actions/changed-files/commit/bad2eb6859141c0628b71ff4ae0fa1a39a8cfd1a)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.4 ([b2dbd42](https://github.com/tj-actions/changed-files/commit/b2dbd4264a1b1ffc90b7b807d01e572eaf935f06)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.3 ([185549c](https://github.com/tj-actions/changed-files/commit/185549c022e131c14c82c9ddfd42ca3fc4a503c2)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v7.5.0 ([f853fd0](https://github.com/tj-actions/changed-files/commit/f853fd059210921daf74c68d70c6f77b2dd21f8c)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([cd3c6e6](https://github.com/tj-actions/changed-files/commit/cd3c6e6bbdabefdea4c7311299eacf440eefabaf)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.12.2 ([e5ce44a](https://github.com/tj-actions/changed-files/commit/e5ce44a30190a3af4c81b960587845596e2300ca)) - (renovate[bot])
|
||||||
|
- **deps:** Update tj-actions/eslint-changed-files action to v24 ([#2019](https://github.com/tj-actions/changed-files/issues/2019)) ([ccdcd17](https://github.com/tj-actions/changed-files/commit/ccdcd17ffd1350eb36c1ff43637d0dbd40b8cdfb)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v44 ([#2017](https://github.com/tj-actions/changed-files/issues/2017))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([e4b8daf](https://github.com/tj-actions/changed-files/commit/e4b8dafc5d0002cc57a632e6a376df5c8c368481)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [44.0.0](https://github.com/tj-actions/changed-files/compare/v43.0.1...v44.0.0) - (2024-03-27)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Ensure the fork remote doesn't exists before creating it ([#2012](https://github.com/tj-actions/changed-files/issues/2012)) ([4bbd49b](https://github.com/tj-actions/changed-files/commit/4bbd49b9986b1300b75e8efb5778350b750ae6c8)) - (Tonye Jack)
|
||||||
|
- Update previos sha for forks ([#2011](https://github.com/tj-actions/changed-files/issues/2011)) ([f0e7702](https://github.com/tj-actions/changed-files/commit/f0e7702ccc35952acb83edeb7400b05c0a67e2be)) - (Tonye Jack)
|
||||||
|
- Update to add the fork remote ([#2010](https://github.com/tj-actions/changed-files/issues/2010)) ([6354e6c](https://github.com/tj-actions/changed-files/commit/6354e6c5426d1e7c7a2d8a5887e26b535837958e)) - (Tonye Jack)
|
||||||
|
- Check for setting remote urls for forks ([#2009](https://github.com/tj-actions/changed-files/issues/2009)) ([1176164](https://github.com/tj-actions/changed-files/commit/117616472fb771d9e030aa0c3741057ad520d9cf)) - (Tonye Jack)
|
||||||
|
- Bug with prs from forks returning incorrect set of changed files ([#2007](https://github.com/tj-actions/changed-files/issues/2007)) ([4ff7936](https://github.com/tj-actions/changed-files/commit/4ff79362e5015d6d0c6c0050b3082c97a5b7e84a)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 17 -->➖ Remove
|
||||||
|
|
||||||
|
- Unused code ([#2014](https://github.com/tj-actions/changed-files/issues/2014)) ([90941b3](https://github.com/tj-actions/changed-files/commit/90941b398f6d8d3ade3e2b8f179d0c64f3679de6)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#2016](https://github.com/tj-actions/changed-files/issues/2016))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([2d756ea](https://github.com/tj-actions/changed-files/commit/2d756ea4c53f7f6b397767d8723b3a10a9f35bf2)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([2d21bbb](https://github.com/tj-actions/changed-files/commit/2d21bbb405b3e0e15479b93c4d9989b4b780a266)) - (Tonye Jack)
|
||||||
|
- Updated README.md ([#2013](https://github.com/tj-actions/changed-files/issues/2013))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([2ca8dc4](https://github.com/tj-actions/changed-files/commit/2ca8dc42f60aab6d0f54beb4e1bd63f15aa53632)) - (tj-actions[bot])
|
||||||
|
- Update README.md ([4621617](https://github.com/tj-actions/changed-files/commit/4621617d4b568fe72798b05a512482442405549c)) - (tonyejack1)
|
||||||
|
- Update README.md ([c6557ed](https://github.com/tj-actions/changed-files/commit/c6557ed000b9d1dbc0abcb5c2a7efc1ef3baa379)) - (Tonye Jack)
|
||||||
|
- Update README.md ([0713a11](https://github.com/tj-actions/changed-files/commit/0713a11242c796d0e601c9ac8f009c2beed0d646)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- Update description of outputs removing asterisks ([#2015](https://github.com/tj-actions/changed-files/issues/2015)) ([ce497c3](https://github.com/tj-actions/changed-files/commit/ce497c39e9043c5dec72f4506445f6b5dbd1f027)) - (tonyejack1)
|
||||||
|
- Update description of other_deleted_files output ([#2008](https://github.com/tj-actions/changed-files/issues/2008)) ([ee096d6](https://github.com/tj-actions/changed-files/commit/ee096d679e877096b9d6e42066f654e0d9d65b1a)) - (tonyejack1)
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v7.4.0 ([0647424](https://github.com/tj-actions/changed-files/commit/064742427d8106b59345e3fabb40031068c82c41)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([efe5e6c](https://github.com/tj-actions/changed-files/commit/efe5e6c7a415f33e8936dea8c45a8fe80be66a92)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v43.0.1 ([#2004](https://github.com/tj-actions/changed-files/issues/2004))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([01e9662](https://github.com/tj-actions/changed-files/commit/01e9662a12a71c5aea74e82ca1c58fa76a640c61)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [43.0.1](https://github.com/tj-actions/changed-files/compare/v43.0.0...v43.0.1) - (2024-03-20)
|
||||||
|
|
||||||
|
## <!-- 1 -->🐛 Bug Fixes
|
||||||
|
|
||||||
|
- Remove warning with detecting the local git repository when using Github's REST API ([#2002](https://github.com/tj-actions/changed-files/issues/2002)) ([077b23f](https://github.com/tj-actions/changed-files/commit/077b23f6a68d9322b1b4ed4d0c88791b30b314d8)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 13 -->📦 Bumps
|
||||||
|
|
||||||
|
- Bump @typescript-eslint/eslint-plugin from 7.3.0 to 7.3.1 ([#1995](https://github.com/tj-actions/changed-files/issues/1995))
|
||||||
|
|
||||||
|
Signed-off-by: dependabot[bot] <support@github.com>
|
||||||
|
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
||||||
|
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([5c6aa49](https://github.com/tj-actions/changed-files/commit/5c6aa4947834d6dd7af1de76ed0e000a8cbc0964)) - (dependabot[bot])
|
||||||
|
- Bump @typescript-eslint/parser from 7.3.0 to 7.3.1 ([#1996](https://github.com/tj-actions/changed-files/issues/1996))
|
||||||
|
|
||||||
|
Signed-off-by: dependabot[bot] <support@github.com>
|
||||||
|
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ([0320702](https://github.com/tj-actions/changed-files/commit/0320702dd5d94814f6c31f81f51dda71ff2d2afc)) - (dependabot[bot])
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Update README.md ([2859a60](https://github.com/tj-actions/changed-files/commit/2859a60726ea6e36242029176333d2d37880bbc5)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency typescript to v5.4.3 ([20576b4](https://github.com/tj-actions/changed-files/commit/20576b4b9ed46d41e2d45a2256e5e2316dde6834)) - (renovate[bot])
|
||||||
|
- Update inputs.ts adding comment about fetch_depth ([#2000](https://github.com/tj-actions/changed-files/issues/2000)) ([0276805](https://github.com/tj-actions/changed-files/commit/02768050b13fdd81ec63a329d99c63c70c0498d5)) - (Tonye Jack)
|
||||||
|
- **deps:** Update dependency @types/node to v20.11.30 ([427adf4](https://github.com/tj-actions/changed-files/commit/427adf47f0f2cc0562d8ed340e6ada019719e4ed)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @typescript-eslint/eslint-plugin to v7.3.1 ([aa0b62a](https://github.com/tj-actions/changed-files/commit/aa0b62a2d0821235d320c725d8a3ac5eaa3d227a)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.11.29 ([3890368](https://github.com/tj-actions/changed-files/commit/38903688b4f76a85d37c033f85de20dc15cae06f)) - (renovate[bot])
|
||||||
|
- **deps:** Update typescript-eslint monorepo to v7.3.0 ([98a74d2](https://github.com/tj-actions/changed-files/commit/98a74d2cd69797eb746b5f87fc277dd48b6fecb7)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([068000d](https://github.com/tj-actions/changed-files/commit/068000d9c6712e4e03b15f450774548890556fc7)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.11.28 ([490ac39](https://github.com/tj-actions/changed-files/commit/490ac3999ea698495f8c32c2936450b9db118b2d)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v43 ([#1990](https://github.com/tj-actions/changed-files/issues/1990))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([d03038e](https://github.com/tj-actions/changed-files/commit/d03038e4e418521b091b356b50cff5d7be177c78)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
# [43.0.0](https://github.com/tj-actions/changed-files/compare/v42.1.0...v43.0.0) - (2024-03-13)
|
||||||
|
|
||||||
|
## <!-- 0 -->🚀 Features
|
||||||
|
|
||||||
|
- Add support for returning true for `any_{changed, modified, deleted}` outputs when no patterns are specified ([#1988](https://github.com/tj-actions/changed-files/issues/1988)) ([a5cf6aa](https://github.com/tj-actions/changed-files/commit/a5cf6aa30cfbe1e0764d2aa5e9f42edb847b6d55)) - (Tonye Jack)
|
||||||
|
|
||||||
|
## <!-- 26 -->🔄 Update
|
||||||
|
|
||||||
|
- Updated README.md ([#1989](https://github.com/tj-actions/changed-files/issues/1989))
|
||||||
|
|
||||||
|
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com> ([77af4be](https://github.com/tj-actions/changed-files/commit/77af4bed286740ef1a6387dc4e4e4dec39f96054)) - (tj-actions[bot])
|
||||||
|
|
||||||
|
## <!-- 7 -->⚙️ Miscellaneous Tasks
|
||||||
|
|
||||||
|
- **deps:** Update dependency @types/node to v20.11.27 ([15807c9](https://github.com/tj-actions/changed-files/commit/15807c9c84ec7ff092c52f2f9fecc600e81420f1)) - (renovate[bot])
|
||||||
|
- **deps:** Update peter-evans/create-pull-request action to v6.0.2 ([dc458cf](https://github.com/tj-actions/changed-files/commit/dc458cf7531fd39dcf942beb39ef6bdcaddc9715)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/lodash to v4.17.0 ([92ca3ee](https://github.com/tj-actions/changed-files/commit/92ca3eebd01cb3fc4d88a4cbd10f344ea4a116d3)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @typescript-eslint/eslint-plugin to v7.2.0 ([f591d0c](https://github.com/tj-actions/changed-files/commit/f591d0c7f0b790ca8c139ce92ff4e8c238cb8940)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @types/node to v20.11.26 ([3502336](https://github.com/tj-actions/changed-files/commit/35023362e2b0ff1cd9b970167a1603614e1ad854)) - (renovate[bot])
|
||||||
|
- **deps:** Update dependency @typescript-eslint/parser to v7.2.0 ([e436cb6](https://github.com/tj-actions/changed-files/commit/e436cb6d85bcd4aecab64c542f2268998a1cdd2f)) - (renovate[bot])
|
||||||
|
- **deps:** Lock file maintenance ([257d47d](https://github.com/tj-actions/changed-files/commit/257d47dfba22be3e0a17f6bad47ff07f7e76747c)) - (renovate[bot])
|
||||||
|
|
||||||
|
## <!-- 9 -->⬆️ Upgrades
|
||||||
|
|
||||||
|
- Upgraded to v42.1.0 ([#1977](https://github.com/tj-actions/changed-files/issues/1977))
|
||||||
|
|
||||||
|
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([4918e11](https://github.com/tj-actions/changed-files/commit/4918e1183080b35a085c91c8abc9e6adc4de61a1)) - (tj-actions[bot])
|
||||||
|
|
||||||
# [42.1.0](https://github.com/tj-actions/changed-files/compare/v42.0.7...v42.1.0) - (2024-03-09)
|
# [42.1.0](https://github.com/tj-actions/changed-files/compare/v42.0.7...v42.1.0) - (2024-03-09)
|
||||||
|
|
||||||
## <!-- 0 -->🚀 Features
|
## <!-- 0 -->🚀 Features
|
||||||
|
|||||||
101
README.md
101
README.md
@@ -116,15 +116,13 @@ jobs:
|
|||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------------------
|
||||||
# Example 1
|
# Example 1
|
||||||
# -----------------------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------------------
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
|
||||||
# with:
|
# with:
|
||||||
# since_last_remote_commit: true
|
# since_last_remote_commit: true
|
||||||
@@ -142,7 +140,7 @@ jobs:
|
|||||||
# -----------------------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------------------
|
||||||
- name: Get all changed markdown files
|
- name: Get all changed markdown files
|
||||||
id: changed-markdown-files
|
id: changed-markdown-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
# Avoid using single or double quotes for multiline patterns
|
# Avoid using single or double quotes for multiline patterns
|
||||||
files: |
|
files: |
|
||||||
@@ -162,7 +160,7 @@ jobs:
|
|||||||
# -----------------------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------------------
|
||||||
- name: Get all test, doc and src files that have changed
|
- name: Get all test, doc and src files that have changed
|
||||||
id: changed-files-yaml
|
id: changed-files-yaml
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files_yaml: |
|
files_yaml: |
|
||||||
doc:
|
doc:
|
||||||
@@ -197,7 +195,7 @@ jobs:
|
|||||||
# -----------------------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------------------
|
||||||
- name: Get changed files in the docs folder
|
- name: Get changed files in the docs folder
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files: docs/*.{js,html} # Alternatively using: `docs/**`
|
files: docs/*.{js,html} # Alternatively using: `docs/**`
|
||||||
files_ignore: docs/static.js
|
files_ignore: docs/static.js
|
||||||
@@ -229,7 +227,7 @@ jobs:
|
|||||||
# NOTE:
|
# NOTE:
|
||||||
# - This is limited to pull_request* events and would raise an error for other events.
|
# - This is limited to pull_request* events and would raise an error for other events.
|
||||||
# - A maximum of 3000 files can be returned.
|
# - A maximum of 3000 files can be returned.
|
||||||
# - For more flexibility and no limitations see "Using local .git history" above.
|
# - For more flexibility and no limitations see "Using local .git directory" above.
|
||||||
|
|
||||||
runs-on: ubuntu-latest # windows-latest || macos-latest
|
runs-on: ubuntu-latest # windows-latest || macos-latest
|
||||||
name: Test changed-files
|
name: Test changed-files
|
||||||
@@ -239,7 +237,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
|
|
||||||
- name: List all changed files
|
- name: List all changed files
|
||||||
env:
|
env:
|
||||||
@@ -282,7 +280,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
# NOTE: `since_last_remote_commit: true` is implied by default and falls back to the previous local commit.
|
||||||
|
|
||||||
- name: List all changed files
|
- name: List all changed files
|
||||||
@@ -322,14 +320,14 @@ Support this project with a :star:
|
|||||||
> * When using `files_yaml*` inputs:
|
> * When using `files_yaml*` inputs:
|
||||||
> * All keys must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
> * All keys must start with a letter or `_` and contain only alphanumeric characters, `-`, or `_`.
|
||||||
>
|
>
|
||||||
> For example, `test` or `test_key` or `test-key` or `_test_key` are all valid.
|
> For example, `test` or `test_key` or `test-key` or `_test_key` are all valid choices.
|
||||||
|
|
||||||
## Inputs ⚙️
|
## Inputs ⚙️
|
||||||
|
|
||||||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: tj-actions/changed-files@v42
|
- uses: tj-actions/changed-files@v44
|
||||||
id: changed-files
|
id: changed-files
|
||||||
with:
|
with:
|
||||||
# Github API URL.
|
# Github API URL.
|
||||||
@@ -391,6 +389,11 @@ Support this project with a :star:
|
|||||||
# Default: "true"
|
# Default: "true"
|
||||||
escape_json: ''
|
escape_json: ''
|
||||||
|
|
||||||
|
# Exclude changes to submodules.
|
||||||
|
# Type: boolean
|
||||||
|
# Default: "false"
|
||||||
|
exclude_submodules: ''
|
||||||
|
|
||||||
# Fail when the initial diff fails.
|
# Fail when the initial diff fails.
|
||||||
# Type: boolean
|
# Type: boolean
|
||||||
# Default: "false"
|
# Default: "false"
|
||||||
@@ -412,6 +415,11 @@ Support this project with a :star:
|
|||||||
# Default: "50"
|
# Default: "50"
|
||||||
fetch_depth: ''
|
fetch_depth: ''
|
||||||
|
|
||||||
|
# Maximum number of retries to fetch missing history.
|
||||||
|
# Type: string
|
||||||
|
# Default: "10"
|
||||||
|
fetch_missing_history_max_retries: ''
|
||||||
|
|
||||||
# File and directory patterns used to detect changes (Defaults to the entire repo if unset).
|
# File and directory patterns used to detect changes (Defaults to the entire repo if unset).
|
||||||
# NOTE: Multiline file/directory patterns should not include quotes.
|
# NOTE: Multiline file/directory patterns should not include quotes.
|
||||||
# Type: string
|
# Type: string
|
||||||
@@ -664,33 +672,33 @@ Support this project with a :star:
|
|||||||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
|
| <a name="output_added_files"></a>[added\_files](#output_added_files) | string | Returns only files that are <br>Added (A). |
|
||||||
| <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
|
| <a name="output_added_files_count"></a>[added\_files\_count](#output_added_files_count) | string | Returns the number of `added_files` |
|
||||||
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. *a combination of (ACMRDTUX)* |
|
| <a name="output_all_changed_and_modified_files"></a>[all\_changed\_and\_modified\_files](#output_all_changed_and_modified_files) | string | Returns all changed and modified <br>files i.e. a combination of <br>(ACMRDTUX) |
|
||||||
| <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
|
| <a name="output_all_changed_and_modified_files_count"></a>[all\_changed\_and\_modified\_files\_count](#output_all_changed_and_modified_files_count) | string | Returns the number of `all_changed_and_modified_files` |
|
||||||
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified and renamed files (ACMR)* |
|
| <a name="output_all_changed_files"></a>[all\_changed\_files](#output_all_changed_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified and renamed files <br>(ACMR) |
|
||||||
| <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
|
| <a name="output_all_changed_files_count"></a>[all\_changed\_files\_count](#output_all_changed_files_count) | string | Returns the number of `all_changed_files` |
|
||||||
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>*a combination of all added, copied, modified, renamed and deleted files (ACMRD)*. |
|
| <a name="output_all_modified_files"></a>[all\_modified\_files](#output_all_modified_files) | string | Returns all changed files i.e. <br>a combination of all added, <br>copied, modified, renamed and deleted <br>files (ACMRD). |
|
||||||
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
|
| <a name="output_all_modified_files_count"></a>[all\_modified\_files\_count](#output_all_modified_files_count) | string | Returns the number of `all_modified_files` |
|
||||||
| <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
|
| <a name="output_all_old_new_renamed_files"></a>[all\_old\_new\_renamed\_files](#output_all_old_new_renamed_files) | string | Returns only files that are <br>Renamed and lists their old <br>and new names. **NOTE:** This <br>requires setting `include_all_old_new_renamed_files` to `true`. <br>Also, keep in mind that <br>this output is global and <br>wouldn't be nested in outputs <br>generated when the `*_yaml_*` input <br>is used. (R) |
|
||||||
| <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
|
| <a name="output_all_old_new_renamed_files_count"></a>[all\_old\_new\_renamed\_files\_count](#output_all_old_new_renamed_files_count) | string | Returns the number of `all_old_new_renamed_files` |
|
||||||
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have changed. This <br>defaults to `true` when no <br>patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
| <a name="output_any_changed"></a>[any\_changed](#output_any_changed) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have changed. This <br>defaults to `true` when no <br>patterns are specified. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||||
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been deleted. <br>This defaults to `true` when <br>no patterns are specified. (D) |
|
| <a name="output_any_deleted"></a>[any\_deleted](#output_any_deleted) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been deleted. <br>This defaults to `true` when <br>no patterns are specified. (D) |
|
||||||
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been modified. <br>This defaults to `true` when <br>no patterns are specified. i.e. <br>*includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
| <a name="output_any_modified"></a>[any\_modified](#output_any_modified) | string | Returns `true` when any of <br>the filenames provided using the <br>`files*` or `files_ignore*` inputs have been modified. <br>This defaults to `true` when <br>no patterns are specified. i.e. <br>*includes a combination of all added, copied, modified, renamed, and deleted files (ACMRD)*. |
|
||||||
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)* |
|
| <a name="output_changed_keys"></a>[changed\_keys](#output_changed_keys) | string | Returns all changed YAML keys <br>when the `files_yaml` input is <br>used. i.e. key that contains <br>any path that has either <br>been added, copied, modified, and <br>renamed (ACMR) |
|
||||||
| <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). |
|
| <a name="output_copied_files"></a>[copied\_files](#output_copied_files) | string | Returns only files that are <br>Copied (C). |
|
||||||
| <a name="output_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
|
| <a name="output_copied_files_count"></a>[copied\_files\_count](#output_copied_files_count) | string | Returns the number of `copied_files` |
|
||||||
| <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
|
| <a name="output_deleted_files"></a>[deleted\_files](#output_deleted_files) | string | Returns only files that are <br>Deleted (D). |
|
||||||
| <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
|
| <a name="output_deleted_files_count"></a>[deleted\_files\_count](#output_deleted_files_count) | string | Returns the number of `deleted_files` |
|
||||||
| <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). |
|
| <a name="output_modified_files"></a>[modified\_files](#output_modified_files) | string | Returns only files that are <br>Modified (M). |
|
||||||
| <a name="output_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
|
| <a name="output_modified_files_count"></a>[modified\_files\_count](#output_modified_files_count) | string | Returns the number of `modified_files` |
|
||||||
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)* |
|
| <a name="output_modified_keys"></a>[modified\_keys](#output_modified_keys) | string | Returns all modified YAML keys <br>when the `files_yaml` input is <br>used. i.e. key that contains <br>any path that has either <br>been added, copied, modified, and <br>deleted (ACMRD) |
|
||||||
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
| <a name="output_only_changed"></a>[only\_changed](#output_only_changed) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
||||||
| <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been deleted. (D) |
|
| <a name="output_only_deleted"></a>[only\_deleted](#output_only_deleted) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been deleted. (D) |
|
||||||
| <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been modified. (ACMRD). |
|
| <a name="output_only_modified"></a>[only\_modified](#output_only_modified) | string | Returns `true` when only files <br>provided using the `files*` or `files_ignore*` inputs <br>have been modified. (ACMRD). |
|
||||||
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*. |
|
| <a name="output_other_changed_files"></a>[other\_changed\_files](#output_other_changed_files) | string | Returns all other changed files <br>not listed in the files <br>input i.e. includes a combination <br>of all added, copied, modified <br>and renamed files (ACMR). |
|
||||||
| <a name="output_other_changed_files_count"></a>[other\_changed\_files\_count](#output_other_changed_files_count) | string | Returns the number of `other_changed_files` |
|
| <a name="output_other_changed_files_count"></a>[other\_changed\_files\_count](#output_other_changed_files_count) | string | Returns the number of `other_changed_files` |
|
||||||
| <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. *a combination of all deleted files (D)* |
|
| <a name="output_other_deleted_files"></a>[other\_deleted\_files](#output_other_deleted_files) | string | Returns all other deleted files <br>not listed in the files <br>input i.e. a combination of <br>all deleted files (D) |
|
||||||
| <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
|
| <a name="output_other_deleted_files_count"></a>[other\_deleted\_files\_count](#output_other_deleted_files_count) | string | Returns the number of `other_deleted_files` |
|
||||||
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)* |
|
| <a name="output_other_modified_files"></a>[other\_modified\_files](#output_other_modified_files) | string | Returns all other modified files <br>not listed in the files <br>input i.e. a combination of <br>all added, copied, modified, and <br>deleted files (ACMRD) |
|
||||||
| <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
|
| <a name="output_other_modified_files_count"></a>[other\_modified\_files\_count](#output_other_modified_files_count) | string | Returns the number of `other_modified_files` |
|
||||||
| <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
|
| <a name="output_renamed_files"></a>[renamed\_files](#output_renamed_files) | string | Returns only files that are <br>Renamed (R). |
|
||||||
| <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
|
| <a name="output_renamed_files_count"></a>[renamed\_files\_count](#output_renamed_files_count) | string | Returns the number of `renamed_files` |
|
||||||
@@ -724,7 +732,7 @@ The format of the version string is as follows:
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -737,7 +745,7 @@ The format of the version string is as follows:
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
|
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
|
||||||
|
|
||||||
@@ -760,7 +768,7 @@ The format of the version string is as follows:
|
|||||||
...
|
...
|
||||||
- name: Get all changed files and use a comma separator in the output
|
- name: Get all changed files and use a comma separator in the output
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
separator: ","
|
separator: ","
|
||||||
...
|
...
|
||||||
@@ -777,7 +785,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
|
|
||||||
- name: List all added files
|
- name: List all added files
|
||||||
env:
|
env:
|
||||||
@@ -800,7 +808,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
|
|
||||||
- name: Run a step if my-file.txt was modified
|
- name: Run a step if my-file.txt was modified
|
||||||
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
|
||||||
@@ -821,7 +829,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
|
|
||||||
- name: Get changed files and write the outputs to a Txt file
|
- name: Get changed files and write the outputs to a Txt file
|
||||||
id: changed-files-write-output-files-txt
|
id: changed-files-write-output-files-txt
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
write_output_files: true
|
write_output_files: true
|
||||||
|
|
||||||
@@ -840,7 +848,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
...
|
...
|
||||||
- name: Get changed files and write the outputs to a JSON file
|
- name: Get changed files and write the outputs to a JSON file
|
||||||
id: changed-files-write-output-files-json
|
id: changed-files-write-output-files-json
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
json: true
|
json: true
|
||||||
write_output_files: true
|
write_output_files: true
|
||||||
@@ -860,7 +868,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@@ -883,7 +891,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
my-file.txt
|
my-file.txt
|
||||||
@@ -934,7 +942,7 @@ See [outputs](#outputs) for a list of all available outputs.
|
|||||||
...
|
...
|
||||||
- name: Get changed files using a source file or list of file(s) to populate to files input.
|
- name: Get changed files using a source file or list of file(s) to populate to files input.
|
||||||
id: changed-files-specific-source-file
|
id: changed-files-specific-source-file
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files_from_source_file: test/changed-files-list.txt
|
files_from_source_file: test/changed-files-list.txt
|
||||||
...
|
...
|
||||||
@@ -951,7 +959,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
|
- name: Get changed files using a source file or list of file(s) to populate to files input and optionally specify more files.
|
||||||
id: changed-files-specific-source-file-and-specify-files
|
id: changed-files-specific-source-file-and-specify-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files_from_source_file: |
|
files_from_source_file: |
|
||||||
test/changed-files-list.txt
|
test/changed-files-list.txt
|
||||||
@@ -972,7 +980,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed files using a different SHA
|
- name: Get changed files using a different SHA
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.event.pull_request.head.sha }}
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
...
|
...
|
||||||
@@ -989,7 +997,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed files using a different base SHA
|
- name: Get changed files using a different base SHA
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ github.event.pull_request.base.sha }}
|
base_sha: ${{ github.event.pull_request.base.sha }}
|
||||||
...
|
...
|
||||||
@@ -1021,7 +1029,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
|
|
||||||
- name: List changed files
|
- name: List changed files
|
||||||
env:
|
env:
|
||||||
@@ -1031,7 +1039,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files in the .github folder
|
- name: Get changed files in the .github folder
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files: .github/**
|
files: .github/**
|
||||||
|
|
||||||
@@ -1062,14 +1070,13 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
- name: Run changed-files with defaults in dir1
|
- name: Run changed-files with defaults in dir1
|
||||||
id: changed-files-for-dir1
|
id: changed-files-for-dir1
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
path: dir1
|
path: dir1
|
||||||
|
|
||||||
- name: List all added files in dir1
|
- name: List all added files in dir1
|
||||||
env:
|
env:
|
||||||
ADDED_FILES: |-
|
ADDED_FILES: ${{ steps.changed-files-for-dir1.outputs.added_files }}
|
||||||
${{ steps.changed-files-for-dir1.outputs.added_files }}
|
|
||||||
run: |
|
run: |
|
||||||
for file in ${ADDED_FILES}; do
|
for file in ${ADDED_FILES}; do
|
||||||
echo "$file was added"
|
echo "$file was added"
|
||||||
@@ -1088,13 +1095,13 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Run changed-files with quotepath disabled
|
- name: Run changed-files with quotepath disabled
|
||||||
id: changed-files-quotepath
|
id: changed-files-quotepath
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
quotepath: "false"
|
quotepath: "false"
|
||||||
|
|
||||||
- name: Run changed-files with quotepath disabled for a specified list of file(s)
|
- name: Run changed-files with quotepath disabled for a specified list of file(s)
|
||||||
id: changed-files-quotepath-specific
|
id: changed-files-quotepath-specific
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
files: test/test-è.txt
|
files: test/test-è.txt
|
||||||
quotepath: "false"
|
quotepath: "false"
|
||||||
@@ -1127,7 +1134,7 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
- name: Run changed-files with the commit of the last successful test workflow run
|
- name: Run changed-files with the commit of the last successful test workflow run
|
||||||
id: changed-files-base-sha-push
|
id: changed-files-base-sha-push
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
|
||||||
...
|
...
|
||||||
@@ -1154,7 +1161,7 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
|
- name: Run changed-files with the commit of the last successful test workflow run on the main branch
|
||||||
id: changed-files-base-sha-pull-request
|
id: changed-files-base-sha-pull-request
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
|
||||||
...
|
...
|
||||||
@@ -1180,7 +1187,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Run changed-files with dir_names
|
- name: Run changed-files with dir_names
|
||||||
id: changed-files-dir-names
|
id: changed-files-dir-names
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
dir_names: "true"
|
dir_names: "true"
|
||||||
...
|
...
|
||||||
@@ -1197,7 +1204,7 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Run changed-files with JSON output
|
- name: Run changed-files with JSON output
|
||||||
id: changed-files-json
|
id: changed-files-json
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
json: "true"
|
json: "true"
|
||||||
...
|
...
|
||||||
@@ -1214,13 +1221,13 @@ See [inputs](#inputs) for more information.
|
|||||||
...
|
...
|
||||||
- name: Get changed-files since 2022-08-19
|
- name: Get changed-files since 2022-08-19
|
||||||
id: changed-files-since
|
id: changed-files-since
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
since: "2022-08-19"
|
since: "2022-08-19"
|
||||||
|
|
||||||
- name: Get changed-files until 2022-08-20
|
- name: Get changed-files until 2022-08-20
|
||||||
id: changed-files-until
|
id: changed-files-until
|
||||||
uses: tj-actions/changed-files@v42
|
uses: tj-actions/changed-files@v44
|
||||||
with:
|
with:
|
||||||
until: "2022-08-20"
|
until: "2022-08-20"
|
||||||
...
|
...
|
||||||
@@ -1252,7 +1259,7 @@ See [inputs](#inputs) for more information.
|
|||||||
|
|
||||||
* [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
|
* [qmk\_firmware uses tj-actions/changed-files to run linters](https://github.com/qmk/qmk_firmware/blob/7a737235ffd49c32d2c5561e8fe53fd96baa7f96/.github/workflows/lint.yml#L30)
|
||||||
|
|
||||||
* [argo-cd uses tj-actions/chnaged-files to detect changed frontend or backend files](https://github.com/argoproj/argo-cd/blob/5bc1850aa1d26301043be9f2fb825d88c80c111c/.github/workflows/ci-build.yaml#L33)
|
* [argo-cd uses tj-actions/changed-files to detect changed frontend or backend files](https://github.com/argoproj/argo-cd/blob/5bc1850aa1d26301043be9f2fb825d88c80c111c/.github/workflows/ci-build.yaml#L33)
|
||||||
|
|
||||||
* [argo-workflows uses tj-actions/changed-files to run specific jobs based on changes detected](https://github.com/argoproj/argo-workflows/blob/baef4856ff2603c76dbe277c825eaa3f9788fc91/.github/workflows/ci-build.yaml#L34)
|
* [argo-workflows uses tj-actions/changed-files to run specific jobs based on changes detected](https://github.com/argoproj/argo-workflows/blob/baef4856ff2603c76dbe277c825eaa3f9788fc91/.github/workflows/ci-build.yaml#L34)
|
||||||
|
|
||||||
@@ -1309,7 +1316,7 @@ Report bugs at https://github.com/tj-actions/changed-files/issues.
|
|||||||
If you are reporting a bug, please include:
|
If you are reporting a bug, please include:
|
||||||
|
|
||||||
* Your operating system name and version.
|
* Your operating system name and version.
|
||||||
* Any details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled)
|
* All essential details about your workflow that might be helpful in troubleshooting. (**NOTE**: Ensure that you include full log outputs with debugging enabled)
|
||||||
* Detailed steps to reproduce the bug.
|
* Detailed steps to reproduce the bug.
|
||||||
|
|
||||||
## Contributors ✨
|
## Contributors ✨
|
||||||
|
|||||||
28
action.yml
28
action.yml
@@ -223,6 +223,18 @@ 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`."
|
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
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
|
exclude_submodules:
|
||||||
|
description: "Exclude changes to submodules."
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
fetch_missing_history_max_retries:
|
||||||
|
description: "Maximum number of retries to fetch missing history."
|
||||||
|
required: false
|
||||||
|
default: "10"
|
||||||
|
use_posix_path_separator:
|
||||||
|
description: "Use POSIX path separator `/` for output filenames."
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
added_files:
|
added_files:
|
||||||
@@ -262,11 +274,11 @@ outputs:
|
|||||||
unknown_files_count:
|
unknown_files_count:
|
||||||
description: "Returns the number of `unknown_files`"
|
description: "Returns the number of `unknown_files`"
|
||||||
all_changed_and_modified_files:
|
all_changed_and_modified_files:
|
||||||
description: "Returns all changed and modified files i.e. *a combination of (ACMRDTUX)*"
|
description: "Returns all changed and modified files i.e. a combination of (ACMRDTUX)"
|
||||||
all_changed_and_modified_files_count:
|
all_changed_and_modified_files_count:
|
||||||
description: "Returns the number of `all_changed_and_modified_files`"
|
description: "Returns the number of `all_changed_and_modified_files`"
|
||||||
all_changed_files:
|
all_changed_files:
|
||||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified and renamed files (ACMR)*"
|
description: "Returns all changed files i.e. a combination of all added, copied, modified and renamed files (ACMR)"
|
||||||
all_changed_files_count:
|
all_changed_files_count:
|
||||||
description: "Returns the number of `all_changed_files`"
|
description: "Returns the number of `all_changed_files`"
|
||||||
any_changed:
|
any_changed:
|
||||||
@@ -274,11 +286,11 @@ outputs:
|
|||||||
only_changed:
|
only_changed:
|
||||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have changed. i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
||||||
other_changed_files:
|
other_changed_files:
|
||||||
description: "Returns all other changed files not listed in the files input i.e. *includes a combination of all added, copied, modified and renamed files (ACMR)*."
|
description: "Returns all other changed files not listed in the files input i.e. includes a combination of all added, copied, modified and renamed files (ACMR)."
|
||||||
other_changed_files_count:
|
other_changed_files_count:
|
||||||
description: "Returns the number of `other_changed_files`"
|
description: "Returns the number of `other_changed_files`"
|
||||||
all_modified_files:
|
all_modified_files:
|
||||||
description: "Returns all changed files i.e. *a combination of all added, copied, modified, renamed and deleted files (ACMRD)*."
|
description: "Returns all changed files i.e. a combination of all added, copied, modified, renamed and deleted files (ACMRD)."
|
||||||
all_modified_files_count:
|
all_modified_files_count:
|
||||||
description: "Returns the number of `all_modified_files`"
|
description: "Returns the number of `all_modified_files`"
|
||||||
any_modified:
|
any_modified:
|
||||||
@@ -286,7 +298,7 @@ outputs:
|
|||||||
only_modified:
|
only_modified:
|
||||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
|
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
|
||||||
other_modified_files:
|
other_modified_files:
|
||||||
description: "Returns all other modified files not listed in the files input i.e. *a combination of all added, copied, modified, and deleted files (ACMRD)*"
|
description: "Returns all other modified files not listed in the files input i.e. a combination of all added, copied, modified, and deleted files (ACMRD)"
|
||||||
other_modified_files_count:
|
other_modified_files_count:
|
||||||
description: "Returns the number of `other_modified_files`"
|
description: "Returns the number of `other_modified_files`"
|
||||||
any_deleted:
|
any_deleted:
|
||||||
@@ -294,13 +306,13 @@ outputs:
|
|||||||
only_deleted:
|
only_deleted:
|
||||||
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
|
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
|
||||||
other_deleted_files:
|
other_deleted_files:
|
||||||
description: "Returns all other deleted files not listed in the files input i.e. *a combination of all deleted files (D)*"
|
description: "Returns all other deleted files not listed in the files input i.e. a combination of all deleted files (D)"
|
||||||
other_deleted_files_count:
|
other_deleted_files_count:
|
||||||
description: "Returns the number of `other_deleted_files`"
|
description: "Returns the number of `other_deleted_files`"
|
||||||
modified_keys:
|
modified_keys:
|
||||||
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and deleted (ACMRD)*"
|
description: "Returns all modified YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and deleted (ACMRD)"
|
||||||
changed_keys:
|
changed_keys:
|
||||||
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. *key that contains any path that has either been added, copied, modified, and renamed (ACMR)*"
|
description: "Returns all changed YAML keys when the `files_yaml` input is used. i.e. key that contains any path that has either been added, copied, modified, and renamed (ACMR)"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
|
|||||||
6367
dist/index.js
generated
vendored
6367
dist/index.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
5249
dist/licenses.txt
generated
vendored
5249
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tj-actions/changed-files",
|
"name": "@tj-actions/changed-files",
|
||||||
"version": "42.1.0",
|
"version": "44.2.0",
|
||||||
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
|
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
|
||||||
"package": "ncc build lib/main.js --source-map --license licenses.txt",
|
"package": "ncc build lib/main.js --source-map --license licenses.txt",
|
||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
|
"update-snapshot": "jest -u",
|
||||||
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@octokit/rest": "^20.0.1",
|
"@octokit/rest": "^20.0.1",
|
||||||
|
"@stdlib/utils-convert-path": "^0.2.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"micromatch": "^4.0.5",
|
"micromatch": "^4.0.5",
|
||||||
"yaml": "^2.3.1"
|
"yaml": "^2.3.1"
|
||||||
@@ -50,10 +52,10 @@
|
|||||||
"@typescript-eslint/parser": "^7.0.0",
|
"@typescript-eslint/parser": "^7.0.0",
|
||||||
"@vercel/ncc": "^0.38.0",
|
"@vercel/ncc": "^0.38.0",
|
||||||
"eslint": "^8.43.0",
|
"eslint": "^8.43.0",
|
||||||
"eslint-plugin-github": "^4.8.0",
|
|
||||||
"eslint-plugin-jest": "^27.2.2",
|
|
||||||
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
|
"eslint-plugin-github": "^4.8.0",
|
||||||
|
"eslint-plugin-jest": "^28.0.0",
|
||||||
|
"eslint-plugin-prettier": "^5.0.0-alpha.2",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
|
|||||||
@@ -2,55 +2,60 @@
|
|||||||
|
|
||||||
exports[`getInputs should correctly parse boolean inputs 1`] = `
|
exports[`getInputs should correctly parse boolean inputs 1`] = `
|
||||||
{
|
{
|
||||||
"apiUrl": undefined,
|
"apiUrl": "",
|
||||||
"baseSha": undefined,
|
"baseSha": "",
|
||||||
"diffRelative": "false",
|
"diffRelative": "false",
|
||||||
"dirNames": "false",
|
"dirNames": "false",
|
||||||
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": "false",
|
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": "false",
|
||||||
"dirNamesExcludeCurrentDir": "false",
|
"dirNamesExcludeCurrentDir": "false",
|
||||||
"dirNamesIncludeFiles": undefined,
|
"dirNamesIncludeFiles": "",
|
||||||
"dirNamesIncludeFilesSeparator": undefined,
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": "false",
|
||||||
"failOnInitialDiffError": "false",
|
"failOnInitialDiffError": "false",
|
||||||
"failOnSubmoduleDiffError": "false",
|
"failOnSubmoduleDiffError": "false",
|
||||||
"fetchAdditionalSubmoduleHistory": "false",
|
"fetchAdditionalSubmoduleHistory": "false",
|
||||||
"files": undefined,
|
"fetchMissingHistoryMaxRetries": 10,
|
||||||
"filesFromSourceFile": undefined,
|
"files": "",
|
||||||
"filesFromSourceFileSeparator": undefined,
|
"filesFromSourceFile": "",
|
||||||
"filesIgnore": undefined,
|
"filesFromSourceFileSeparator": "",
|
||||||
"filesIgnoreFromSourceFile": undefined,
|
"filesIgnore": "",
|
||||||
"filesIgnoreFromSourceFileSeparator": undefined,
|
"filesIgnoreFromSourceFile": "",
|
||||||
"filesIgnoreSeparator": undefined,
|
"filesIgnoreFromSourceFileSeparator": "",
|
||||||
"filesIgnoreYaml": undefined,
|
"filesIgnoreSeparator": "",
|
||||||
"filesIgnoreYamlFromSourceFile": undefined,
|
"filesIgnoreYaml": "",
|
||||||
"filesIgnoreYamlFromSourceFileSeparator": undefined,
|
"filesIgnoreYamlFromSourceFile": "",
|
||||||
"filesSeparator": undefined,
|
"filesIgnoreYamlFromSourceFileSeparator": "",
|
||||||
"filesYaml": undefined,
|
"filesSeparator": "",
|
||||||
"filesYamlFromSourceFile": undefined,
|
"filesYaml": "",
|
||||||
"filesYamlFromSourceFileSeparator": undefined,
|
"filesYamlFromSourceFile": "",
|
||||||
|
"filesYamlFromSourceFileSeparator": "",
|
||||||
"includeAllOldNewRenamedFiles": "false",
|
"includeAllOldNewRenamedFiles": "false",
|
||||||
"json": true,
|
"json": true,
|
||||||
"negationPatternsFirst": "false",
|
"negationPatternsFirst": "false",
|
||||||
"oldNewFilesSeparator": undefined,
|
"oldNewFilesSeparator": " ",
|
||||||
"oldNewSeparator": undefined,
|
"oldNewSeparator": ",",
|
||||||
"outputDir": undefined,
|
"outputDir": "",
|
||||||
"outputRenamedFilesAsDeletedAndAdded": "false",
|
"outputRenamedFilesAsDeletedAndAdded": "false",
|
||||||
"path": undefined,
|
"path": ".",
|
||||||
"quotepath": "false",
|
"quotepath": "false",
|
||||||
"recoverDeletedFiles": "false",
|
"recoverDeletedFiles": "false",
|
||||||
"recoverDeletedFilesToDestination": undefined,
|
"recoverDeletedFilesToDestination": "",
|
||||||
"recoverFiles": undefined,
|
"recoverFiles": "",
|
||||||
"recoverFilesIgnore": undefined,
|
"recoverFilesIgnore": "",
|
||||||
"recoverFilesIgnoreSeparator": undefined,
|
"recoverFilesIgnoreSeparator": "
|
||||||
"recoverFilesSeparator": undefined,
|
",
|
||||||
|
"recoverFilesSeparator": "
|
||||||
|
",
|
||||||
"safeOutput": "false",
|
"safeOutput": "false",
|
||||||
"separator": undefined,
|
"separator": "",
|
||||||
"sha": undefined,
|
"sha": "",
|
||||||
"since": undefined,
|
"since": "",
|
||||||
"sinceLastRemoteCommit": "false",
|
"sinceLastRemoteCommit": "false",
|
||||||
"skipInitialFetch": "true",
|
"skipInitialFetch": "true",
|
||||||
"token": undefined,
|
"token": "",
|
||||||
"until": undefined,
|
"until": "",
|
||||||
|
"usePosixPathSeparator": "false",
|
||||||
"useRestApi": "false",
|
"useRestApi": "false",
|
||||||
"writeOutputFiles": "false",
|
"writeOutputFiles": "false",
|
||||||
}
|
}
|
||||||
@@ -68,6 +73,7 @@ exports[`getInputs should correctly parse numeric inputs 1`] = `
|
|||||||
"dirNamesIncludeFilesSeparator": "",
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"dirNamesMaxDepth": 2,
|
"dirNamesMaxDepth": 2,
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
"failOnInitialDiffError": false,
|
"failOnInitialDiffError": false,
|
||||||
"failOnSubmoduleDiffError": false,
|
"failOnSubmoduleDiffError": false,
|
||||||
"fetchAdditionalSubmoduleHistory": false,
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
@@ -109,6 +115,7 @@ exports[`getInputs should correctly parse numeric inputs 1`] = `
|
|||||||
"skipInitialFetch": false,
|
"skipInitialFetch": false,
|
||||||
"token": "",
|
"token": "",
|
||||||
"until": "",
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
"useRestApi": false,
|
"useRestApi": false,
|
||||||
"writeOutputFiles": false,
|
"writeOutputFiles": false,
|
||||||
}
|
}
|
||||||
@@ -125,6 +132,7 @@ exports[`getInputs should correctly parse string inputs 1`] = `
|
|||||||
"dirNamesIncludeFiles": "",
|
"dirNamesIncludeFiles": "",
|
||||||
"dirNamesIncludeFilesSeparator": "",
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
"failOnInitialDiffError": false,
|
"failOnInitialDiffError": false,
|
||||||
"failOnSubmoduleDiffError": false,
|
"failOnSubmoduleDiffError": false,
|
||||||
"fetchAdditionalSubmoduleHistory": false,
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
@@ -165,6 +173,7 @@ exports[`getInputs should correctly parse string inputs 1`] = `
|
|||||||
"skipInitialFetch": false,
|
"skipInitialFetch": false,
|
||||||
"token": "token",
|
"token": "token",
|
||||||
"until": "",
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
"useRestApi": false,
|
"useRestApi": false,
|
||||||
"writeOutputFiles": false,
|
"writeOutputFiles": false,
|
||||||
}
|
}
|
||||||
@@ -182,6 +191,7 @@ exports[`getInputs should handle invalid numeric inputs correctly 1`] = `
|
|||||||
"dirNamesIncludeFilesSeparator": "",
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"dirNamesMaxDepth": 2,
|
"dirNamesMaxDepth": 2,
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
"failOnInitialDiffError": false,
|
"failOnInitialDiffError": false,
|
||||||
"failOnSubmoduleDiffError": false,
|
"failOnSubmoduleDiffError": false,
|
||||||
"fetchAdditionalSubmoduleHistory": false,
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
@@ -223,6 +233,7 @@ exports[`getInputs should handle invalid numeric inputs correctly 1`] = `
|
|||||||
"skipInitialFetch": false,
|
"skipInitialFetch": false,
|
||||||
"token": "",
|
"token": "",
|
||||||
"until": "",
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
"useRestApi": false,
|
"useRestApi": false,
|
||||||
"writeOutputFiles": false,
|
"writeOutputFiles": false,
|
||||||
}
|
}
|
||||||
@@ -240,6 +251,7 @@ exports[`getInputs should handle negative numeric inputs correctly 1`] = `
|
|||||||
"dirNamesIncludeFilesSeparator": "",
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"dirNamesMaxDepth": -2,
|
"dirNamesMaxDepth": -2,
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
"failOnInitialDiffError": false,
|
"failOnInitialDiffError": false,
|
||||||
"failOnSubmoduleDiffError": false,
|
"failOnSubmoduleDiffError": false,
|
||||||
"fetchAdditionalSubmoduleHistory": false,
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
@@ -281,6 +293,7 @@ exports[`getInputs should handle negative numeric inputs correctly 1`] = `
|
|||||||
"skipInitialFetch": false,
|
"skipInitialFetch": false,
|
||||||
"token": "",
|
"token": "",
|
||||||
"until": "",
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
"useRestApi": false,
|
"useRestApi": false,
|
||||||
"writeOutputFiles": false,
|
"writeOutputFiles": false,
|
||||||
}
|
}
|
||||||
@@ -288,55 +301,60 @@ exports[`getInputs should handle negative numeric inputs correctly 1`] = `
|
|||||||
|
|
||||||
exports[`getInputs should return default values when no inputs are provided 1`] = `
|
exports[`getInputs should return default values when no inputs are provided 1`] = `
|
||||||
{
|
{
|
||||||
"apiUrl": undefined,
|
"apiUrl": "",
|
||||||
"baseSha": undefined,
|
"baseSha": "",
|
||||||
"diffRelative": true,
|
"diffRelative": true,
|
||||||
"dirNames": false,
|
"dirNames": false,
|
||||||
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
|
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
|
||||||
"dirNamesExcludeCurrentDir": false,
|
"dirNamesExcludeCurrentDir": false,
|
||||||
"dirNamesIncludeFiles": undefined,
|
"dirNamesIncludeFiles": "",
|
||||||
"dirNamesIncludeFilesSeparator": undefined,
|
"dirNamesIncludeFilesSeparator": "",
|
||||||
"escapeJson": false,
|
"escapeJson": false,
|
||||||
|
"excludeSubmodules": false,
|
||||||
"failOnInitialDiffError": false,
|
"failOnInitialDiffError": false,
|
||||||
"failOnSubmoduleDiffError": false,
|
"failOnSubmoduleDiffError": false,
|
||||||
"fetchAdditionalSubmoduleHistory": false,
|
"fetchAdditionalSubmoduleHistory": false,
|
||||||
"files": undefined,
|
"fetchMissingHistoryMaxRetries": 10,
|
||||||
"filesFromSourceFile": undefined,
|
"files": "",
|
||||||
"filesFromSourceFileSeparator": undefined,
|
"filesFromSourceFile": "",
|
||||||
"filesIgnore": undefined,
|
"filesFromSourceFileSeparator": "",
|
||||||
"filesIgnoreFromSourceFile": undefined,
|
"filesIgnore": "",
|
||||||
"filesIgnoreFromSourceFileSeparator": undefined,
|
"filesIgnoreFromSourceFile": "",
|
||||||
"filesIgnoreSeparator": undefined,
|
"filesIgnoreFromSourceFileSeparator": "",
|
||||||
"filesIgnoreYaml": undefined,
|
"filesIgnoreSeparator": "",
|
||||||
"filesIgnoreYamlFromSourceFile": undefined,
|
"filesIgnoreYaml": "",
|
||||||
"filesIgnoreYamlFromSourceFileSeparator": undefined,
|
"filesIgnoreYamlFromSourceFile": "",
|
||||||
"filesSeparator": undefined,
|
"filesIgnoreYamlFromSourceFileSeparator": "",
|
||||||
"filesYaml": undefined,
|
"filesSeparator": "",
|
||||||
"filesYamlFromSourceFile": undefined,
|
"filesYaml": "",
|
||||||
"filesYamlFromSourceFileSeparator": undefined,
|
"filesYamlFromSourceFile": "",
|
||||||
|
"filesYamlFromSourceFileSeparator": "",
|
||||||
"includeAllOldNewRenamedFiles": false,
|
"includeAllOldNewRenamedFiles": false,
|
||||||
"json": false,
|
"json": false,
|
||||||
"negationPatternsFirst": false,
|
"negationPatternsFirst": false,
|
||||||
"oldNewFilesSeparator": undefined,
|
"oldNewFilesSeparator": " ",
|
||||||
"oldNewSeparator": undefined,
|
"oldNewSeparator": ",",
|
||||||
"outputDir": undefined,
|
"outputDir": "",
|
||||||
"outputRenamedFilesAsDeletedAndAdded": false,
|
"outputRenamedFilesAsDeletedAndAdded": false,
|
||||||
"path": undefined,
|
"path": ".",
|
||||||
"quotepath": true,
|
"quotepath": true,
|
||||||
"recoverDeletedFiles": false,
|
"recoverDeletedFiles": false,
|
||||||
"recoverDeletedFilesToDestination": undefined,
|
"recoverDeletedFilesToDestination": "",
|
||||||
"recoverFiles": undefined,
|
"recoverFiles": "",
|
||||||
"recoverFilesIgnore": undefined,
|
"recoverFilesIgnore": "",
|
||||||
"recoverFilesIgnoreSeparator": undefined,
|
"recoverFilesIgnoreSeparator": "
|
||||||
"recoverFilesSeparator": undefined,
|
",
|
||||||
|
"recoverFilesSeparator": "
|
||||||
|
",
|
||||||
"safeOutput": false,
|
"safeOutput": false,
|
||||||
"separator": undefined,
|
"separator": "",
|
||||||
"sha": undefined,
|
"sha": "",
|
||||||
"since": undefined,
|
"since": "",
|
||||||
"sinceLastRemoteCommit": false,
|
"sinceLastRemoteCommit": false,
|
||||||
"skipInitialFetch": false,
|
"skipInitialFetch": false,
|
||||||
"token": undefined,
|
"token": "",
|
||||||
"until": undefined,
|
"until": "",
|
||||||
|
"usePosixPathSeparator": false,
|
||||||
"useRestApi": false,
|
"useRestApi": false,
|
||||||
"writeOutputFiles": false,
|
"writeOutputFiles": false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ describe('getInputs', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should return default values when no inputs are provided', () => {
|
test('should return default values when no inputs are provided', () => {
|
||||||
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
|
;(core.getInput as jest.Mock).mockImplementation(name => {
|
||||||
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
|
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
|
||||||
return g[1].toUpperCase()
|
return g[1].toUpperCase()
|
||||||
}) as keyof Inputs
|
}) as keyof Inputs
|
||||||
@@ -30,7 +30,7 @@ describe('getInputs', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('should correctly parse boolean inputs', () => {
|
test('should correctly parse boolean inputs', () => {
|
||||||
;(core.getBooleanInput as jest.Mock).mockImplementation(name => {
|
;(core.getInput as jest.Mock).mockImplementation(name => {
|
||||||
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
|
const camelCaseName = name.replace(/_([a-z])/g, (g: string[]) => {
|
||||||
return g[1].toUpperCase()
|
return g[1].toUpperCase()
|
||||||
}) as keyof Inputs
|
}) as keyof Inputs
|
||||||
|
|||||||
@@ -635,7 +635,10 @@ describe('utils test', () => {
|
|||||||
failOnInitialDiffError: false,
|
failOnInitialDiffError: false,
|
||||||
failOnSubmoduleDiffError: false,
|
failOnSubmoduleDiffError: false,
|
||||||
negationPatternsFirst: false,
|
negationPatternsFirst: false,
|
||||||
useRestApi: false
|
useRestApi: false,
|
||||||
|
excludeSubmodules: false,
|
||||||
|
fetchMissingHistoryMaxRetries: 10,
|
||||||
|
usePosixPathSeparator: false
|
||||||
}
|
}
|
||||||
|
|
||||||
const coreWarningSpy = jest.spyOn(core, 'warning')
|
const coreWarningSpy = jest.spyOn(core, 'warning')
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
||||||
import flatten from 'lodash/flatten'
|
import flatten from 'lodash/flatten'
|
||||||
|
import convertPath from '@stdlib/utils-convert-path'
|
||||||
import mm from 'micromatch'
|
import mm from 'micromatch'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
|
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
|
||||||
@@ -121,13 +122,13 @@ export const processChangedFiles = async ({
|
|||||||
export const getRenamedFiles = async ({
|
export const getRenamedFiles = async ({
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
}): Promise<{paths: string; count: string}> => {
|
}): Promise<{paths: string; count: string}> => {
|
||||||
@@ -139,7 +140,7 @@ export const getRenamedFiles = async ({
|
|||||||
oldNewSeparator: inputs.oldNewSeparator
|
oldNewSeparator: inputs.oldNewSeparator
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
for (const submodulePath of submodulePaths) {
|
for (const submodulePath of submodulePaths) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@@ -217,7 +218,7 @@ export type ChangedFiles = {
|
|||||||
|
|
||||||
export const getAllDiffFiles = async ({
|
export const getAllDiffFiles = async ({
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths,
|
submodulePaths,
|
||||||
outputRenamedFilesAsDeletedAndAdded,
|
outputRenamedFilesAsDeletedAndAdded,
|
||||||
@@ -226,7 +227,7 @@ export const getAllDiffFiles = async ({
|
|||||||
failOnSubmoduleDiffError
|
failOnSubmoduleDiffError
|
||||||
}: {
|
}: {
|
||||||
workingDirectory: string
|
workingDirectory: string
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
outputRenamedFilesAsDeletedAndAdded: boolean
|
outputRenamedFilesAsDeletedAndAdded: boolean
|
||||||
@@ -243,7 +244,7 @@ export const getAllDiffFiles = async ({
|
|||||||
failOnInitialDiffError
|
failOnInitialDiffError
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
for (const submodulePath of submodulePaths) {
|
for (const submodulePath of submodulePaths) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
@@ -355,7 +356,11 @@ function* getChangeTypeFilesGenerator({
|
|||||||
filePaths,
|
filePaths,
|
||||||
dirNamesIncludeFilePatterns
|
dirNamesIncludeFilePatterns
|
||||||
})) {
|
})) {
|
||||||
yield filePath
|
if (isWindows() && inputs.usePosixPathSeparator) {
|
||||||
|
yield convertPath(filePath, 'mixed')
|
||||||
|
} else {
|
||||||
|
yield filePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,7 +407,11 @@ function* getAllChangeTypeFilesGenerator({
|
|||||||
filePaths,
|
filePaths,
|
||||||
dirNamesIncludeFilePatterns
|
dirNamesIncludeFilePatterns
|
||||||
})) {
|
})) {
|
||||||
yield filePath
|
if (isWindows() && inputs.usePosixPathSeparator) {
|
||||||
|
yield convertPath(filePath, 'mixed')
|
||||||
|
} else {
|
||||||
|
yield filePath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
103
src/commitSha.ts
103
src/commitSha.ts
@@ -86,15 +86,27 @@ export interface DiffResult {
|
|||||||
initialCommit?: boolean
|
initialCommit?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSHAForNonPullRequestEvent = async (
|
interface SHAForNonPullRequestEvent {
|
||||||
inputs: Inputs,
|
inputs: Inputs
|
||||||
env: Env,
|
env: Env
|
||||||
workingDirectory: string,
|
workingDirectory: string
|
||||||
isShallow: boolean,
|
isShallow: boolean
|
||||||
hasSubmodule: boolean,
|
diffSubmodule: boolean
|
||||||
gitFetchExtraArgs: string[],
|
gitFetchExtraArgs: string[]
|
||||||
isTag: boolean
|
isTag: boolean
|
||||||
): Promise<DiffResult> => {
|
remoteName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSHAForNonPullRequestEvent = async ({
|
||||||
|
inputs,
|
||||||
|
env,
|
||||||
|
workingDirectory,
|
||||||
|
isShallow,
|
||||||
|
diffSubmodule,
|
||||||
|
gitFetchExtraArgs,
|
||||||
|
isTag,
|
||||||
|
remoteName
|
||||||
|
}: SHAForNonPullRequestEvent): Promise<DiffResult> => {
|
||||||
let targetBranch = env.GITHUB_REF_NAME
|
let targetBranch = env.GITHUB_REF_NAME
|
||||||
let currentBranch = targetBranch
|
let currentBranch = targetBranch
|
||||||
let initialCommit = false
|
let initialCommit = false
|
||||||
@@ -122,8 +134,8 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
`--deepen=${inputs.fetchDepth}`,
|
`--deepen=${inputs.fetchDepth}`,
|
||||||
'origin',
|
remoteName,
|
||||||
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
|
`+refs/heads/${sourceBranch}:refs/remotes/${remoteName}/${sourceBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -134,13 +146,13 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
`--deepen=${inputs.fetchDepth}`,
|
`--deepen=${inputs.fetchDepth}`,
|
||||||
'origin',
|
remoteName,
|
||||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -152,7 +164,7 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -307,14 +319,23 @@ export const getSHAForNonPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSHAForPullRequestEvent = async (
|
interface SHAForPullRequestEvent {
|
||||||
inputs: Inputs,
|
inputs: Inputs
|
||||||
env: Env,
|
workingDirectory: string
|
||||||
workingDirectory: string,
|
isShallow: boolean
|
||||||
isShallow: boolean,
|
diffSubmodule: boolean
|
||||||
hasSubmodule: boolean,
|
|
||||||
gitFetchExtraArgs: string[]
|
gitFetchExtraArgs: string[]
|
||||||
): Promise<DiffResult> => {
|
remoteName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSHAForPullRequestEvent = async ({
|
||||||
|
inputs,
|
||||||
|
workingDirectory,
|
||||||
|
isShallow,
|
||||||
|
diffSubmodule,
|
||||||
|
gitFetchExtraArgs,
|
||||||
|
remoteName
|
||||||
|
}: SHAForPullRequestEvent): Promise<DiffResult> => {
|
||||||
let targetBranch = github.context.payload.pull_request?.base?.ref
|
let targetBranch = github.context.payload.pull_request?.base?.ref
|
||||||
const currentBranch = github.context.payload.pull_request?.head?.ref
|
const currentBranch = github.context.payload.pull_request?.head?.ref
|
||||||
if (inputs.sinceLastRemoteCommit) {
|
if (inputs.sinceLastRemoteCommit) {
|
||||||
@@ -330,7 +351,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
...gitFetchExtraArgs,
|
...gitFetchExtraArgs,
|
||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
'origin',
|
remoteName,
|
||||||
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
|
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@@ -343,8 +364,8 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
`--deepen=${inputs.fetchDepth}`,
|
`--deepen=${inputs.fetchDepth}`,
|
||||||
'origin',
|
remoteName,
|
||||||
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
|
`+refs/heads/${currentBranch}*:refs/remotes/${remoteName}/${currentBranch}*`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -364,12 +385,12 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
`--deepen=${inputs.fetchDepth}`,
|
`--deepen=${inputs.fetchDepth}`,
|
||||||
'origin',
|
remoteName,
|
||||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -382,7 +403,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
|
||||||
await gitFetchSubmodules({
|
await gitFetchSubmodules({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -427,10 +448,7 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!github.context.payload.pull_request?.base?.ref) {
|
||||||
!github.context.payload.pull_request?.base?.ref ||
|
|
||||||
github.context.payload.pull_request?.head?.repo?.fork === true
|
|
||||||
) {
|
|
||||||
diff = '..'
|
diff = '..'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,17 +505,14 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (github.context.payload.action === 'closed') {
|
previousSha = github.context.payload.pull_request?.base?.sha
|
||||||
previousSha = github.context.payload.pull_request?.base?.sha
|
|
||||||
} else {
|
if (!previousSha) {
|
||||||
previousSha = await getRemoteBranchHeadSha({
|
previousSha = await getRemoteBranchHeadSha({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
|
remoteName,
|
||||||
branch: targetBranch
|
branch: targetBranch
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!previousSha) {
|
|
||||||
previousSha = github.context.payload.pull_request?.base?.sha
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isShallow) {
|
if (isShallow) {
|
||||||
@@ -513,7 +528,11 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'Merge base is not in the local history, fetching remote target branch...'
|
'Merge base is not in the local history, fetching remote target branch...'
|
||||||
)
|
)
|
||||||
|
|
||||||
for (let i = 1; i <= 10; i++) {
|
for (
|
||||||
|
let i = 1;
|
||||||
|
i <= (inputs.fetchMissingHistoryMaxRetries || 10);
|
||||||
|
i++
|
||||||
|
) {
|
||||||
await gitFetch({
|
await gitFetch({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
args: [
|
args: [
|
||||||
@@ -521,8 +540,8 @@ export const getSHAForPullRequestEvent = async (
|
|||||||
'-u',
|
'-u',
|
||||||
'--progress',
|
'--progress',
|
||||||
`--deepen=${inputs.fetchDepth}`,
|
`--deepen=${inputs.fetchDepth}`,
|
||||||
'origin',
|
remoteName,
|
||||||
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
|
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -20,5 +20,8 @@ export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
|
|||||||
oldNewFilesSeparator: ' ',
|
oldNewFilesSeparator: ' ',
|
||||||
skipInitialFetch: false,
|
skipInitialFetch: false,
|
||||||
fetchAdditionalSubmoduleHistory: false,
|
fetchAdditionalSubmoduleHistory: false,
|
||||||
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false
|
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
|
||||||
|
excludeSubmodules: false,
|
||||||
|
fetchMissingHistoryMaxRetries: 10,
|
||||||
|
usePosixPathSeparator: false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ export type Inputs = {
|
|||||||
failOnSubmoduleDiffError: boolean
|
failOnSubmoduleDiffError: boolean
|
||||||
negationPatternsFirst: boolean
|
negationPatternsFirst: boolean
|
||||||
useRestApi: boolean
|
useRestApi: boolean
|
||||||
|
excludeSubmodules: boolean
|
||||||
|
fetchMissingHistoryMaxRetries?: number
|
||||||
|
usePosixPathSeparator: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getInputs = (): Inputs => {
|
export const getInputs = (): Inputs => {
|
||||||
@@ -240,6 +243,22 @@ export const getInputs = (): Inputs => {
|
|||||||
required: false
|
required: false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const excludeSubmodules = core.getBooleanInput('exclude_submodules', {
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const fetchMissingHistoryMaxRetries = core.getInput(
|
||||||
|
'fetch_missing_history_max_retries',
|
||||||
|
{required: false}
|
||||||
|
)
|
||||||
|
|
||||||
|
const usePosixPathSeparator = core.getBooleanInput(
|
||||||
|
'use_posix_path_separator',
|
||||||
|
{
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const inputs: Inputs = {
|
const inputs: Inputs = {
|
||||||
files,
|
files,
|
||||||
filesSeparator,
|
filesSeparator,
|
||||||
@@ -279,6 +298,8 @@ export const getInputs = (): Inputs => {
|
|||||||
skipInitialFetch,
|
skipInitialFetch,
|
||||||
fetchAdditionalSubmoduleHistory,
|
fetchAdditionalSubmoduleHistory,
|
||||||
dirNamesDeletedFilesIncludeOnlyDeletedDirs,
|
dirNamesDeletedFilesIncludeOnlyDeletedDirs,
|
||||||
|
excludeSubmodules,
|
||||||
|
usePosixPathSeparator,
|
||||||
// End Not Supported via REST API
|
// End Not Supported via REST API
|
||||||
dirNames,
|
dirNames,
|
||||||
dirNamesExcludeCurrentDir,
|
dirNamesExcludeCurrentDir,
|
||||||
@@ -297,6 +318,7 @@ export const getInputs = (): Inputs => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fetchDepth) {
|
if (fetchDepth) {
|
||||||
|
// Fallback to at least 2 if the fetch_depth is less than 2
|
||||||
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2)
|
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,5 +326,13 @@ export const getInputs = (): Inputs => {
|
|||||||
inputs.dirNamesMaxDepth = parseInt(dirNamesMaxDepth, 10)
|
inputs.dirNamesMaxDepth = parseInt(dirNamesMaxDepth, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fetchMissingHistoryMaxRetries) {
|
||||||
|
// Fallback to at least 1 if the fetch_missing_history_max_retries is less than 1
|
||||||
|
inputs.fetchMissingHistoryMaxRetries = Math.max(
|
||||||
|
parseInt(fetchMissingHistoryMaxRetries, 10),
|
||||||
|
1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return inputs
|
return inputs
|
||||||
}
|
}
|
||||||
|
|||||||
43
src/main.ts
43
src/main.ts
@@ -64,14 +64,26 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
const isShallow = await isRepoShallow({cwd: workingDirectory})
|
||||||
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
|
let diffSubmodule = false
|
||||||
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
|
let gitFetchExtraArgs = ['--no-tags', '--prune']
|
||||||
|
|
||||||
|
if (inputs.excludeSubmodules) {
|
||||||
|
core.info('Excluding submodules from the diff')
|
||||||
|
} else {
|
||||||
|
diffSubmodule = await submoduleExists({cwd: workingDirectory})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diffSubmodule) {
|
||||||
|
gitFetchExtraArgs.push('--recurse-submodules')
|
||||||
|
}
|
||||||
|
|
||||||
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
|
const isTag = env.GITHUB_REF?.startsWith('refs/tags/')
|
||||||
|
const remoteName = 'origin'
|
||||||
const outputRenamedFilesAsDeletedAndAdded =
|
const outputRenamedFilesAsDeletedAndAdded =
|
||||||
inputs.outputRenamedFilesAsDeletedAndAdded
|
inputs.outputRenamedFilesAsDeletedAndAdded
|
||||||
let submodulePaths: string[] = []
|
let submodulePaths: string[] = []
|
||||||
|
|
||||||
if (hasSubmodule) {
|
if (diffSubmodule) {
|
||||||
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
|
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,29 +95,30 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
|
|
||||||
if (!github.context.payload.pull_request?.base?.ref) {
|
if (!github.context.payload.pull_request?.base?.ref) {
|
||||||
core.info(`Running on a ${github.context.eventName || 'push'} event...`)
|
core.info(`Running on a ${github.context.eventName || 'push'} event...`)
|
||||||
diffResult = await getSHAForNonPullRequestEvent(
|
diffResult = await getSHAForNonPullRequestEvent({
|
||||||
inputs,
|
inputs,
|
||||||
env,
|
env,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
isShallow,
|
isShallow,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
gitFetchExtraArgs,
|
gitFetchExtraArgs,
|
||||||
isTag
|
isTag,
|
||||||
)
|
remoteName
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
`Running on a ${github.context.eventName || 'pull_request'} (${
|
`Running on a ${github.context.eventName || 'pull_request'} (${
|
||||||
github.context.payload.action
|
github.context.payload.action
|
||||||
}) event...`
|
}) event...`
|
||||||
)
|
)
|
||||||
diffResult = await getSHAForPullRequestEvent(
|
diffResult = await getSHAForPullRequestEvent({
|
||||||
inputs,
|
inputs,
|
||||||
env,
|
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
isShallow,
|
isShallow,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
gitFetchExtraArgs
|
gitFetchExtraArgs,
|
||||||
)
|
remoteName
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diffResult.initialCommit) {
|
if (diffResult.initialCommit) {
|
||||||
@@ -120,7 +133,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
|
|
||||||
const allDiffFiles = await getAllDiffFiles({
|
const allDiffFiles = await getAllDiffFiles({
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths,
|
submodulePaths,
|
||||||
outputRenamedFilesAsDeletedAndAdded,
|
outputRenamedFilesAsDeletedAndAdded,
|
||||||
@@ -146,7 +159,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
|
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
|
||||||
recoverPatterns,
|
recoverPatterns,
|
||||||
diffResult,
|
diffResult,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -164,7 +177,7 @@ const getChangedFilesFromLocalGitHistory = async ({
|
|||||||
const allOldNewRenamedFiles = await getRenamedFiles({
|
const allOldNewRenamedFiles = await getRenamedFiles({
|
||||||
inputs,
|
inputs,
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
diffResult,
|
diffResult,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
})
|
})
|
||||||
|
|||||||
26
src/utils.ts
26
src/utils.ts
@@ -32,11 +32,13 @@ export const normalizeSeparators = (p: string): string => {
|
|||||||
|
|
||||||
// Remove redundant slashes
|
// Remove redundant slashes
|
||||||
const isUnc = /^\\\\+[^\\]/.test(p) // e.g. \\hello
|
const isUnc = /^\\\\+[^\\]/.test(p) // e.g. \\hello
|
||||||
return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\') // preserve leading \\ for UNC
|
p = (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\') // preserve leading \\ for UNC
|
||||||
|
} else {
|
||||||
|
// Remove redundant slashes on Linux/macOS
|
||||||
|
p = p.replace(/\/\/+/g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove redundant slashes
|
return p
|
||||||
return p.replace(/\/\/+/g, '/')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -680,25 +682,21 @@ export const isInsideWorkTree = async ({
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (stdout.trim() !== 'true') {
|
|
||||||
core.warning(
|
|
||||||
`The current working directory is not inside a git repository: ${cwd}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return stdout.trim() === 'true'
|
return stdout.trim() === 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getRemoteBranchHeadSha = async ({
|
export const getRemoteBranchHeadSha = async ({
|
||||||
cwd,
|
cwd,
|
||||||
branch
|
branch,
|
||||||
|
remoteName
|
||||||
}: {
|
}: {
|
||||||
cwd: string
|
cwd: string
|
||||||
branch: string
|
branch: string
|
||||||
|
remoteName: string
|
||||||
}): Promise<string> => {
|
}): Promise<string> => {
|
||||||
const {stdout} = await exec.getExecOutput(
|
const {stdout} = await exec.getExecOutput(
|
||||||
'git',
|
'git',
|
||||||
['rev-parse', `origin/${branch}`],
|
['rev-parse', `${remoteName}/${branch}`],
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
silent: !core.isDebug()
|
silent: !core.isDebug()
|
||||||
@@ -1417,7 +1415,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
deletedFiles,
|
deletedFiles,
|
||||||
recoverPatterns,
|
recoverPatterns,
|
||||||
diffResult,
|
diffResult,
|
||||||
hasSubmodule,
|
diffSubmodule,
|
||||||
submodulePaths
|
submodulePaths
|
||||||
}: {
|
}: {
|
||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
@@ -1425,7 +1423,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
deletedFiles: string[]
|
deletedFiles: string[]
|
||||||
recoverPatterns: string[]
|
recoverPatterns: string[]
|
||||||
diffResult: DiffResult
|
diffResult: DiffResult
|
||||||
hasSubmodule: boolean
|
diffSubmodule: boolean
|
||||||
submodulePaths: string[]
|
submodulePaths: string[]
|
||||||
}): Promise<void> => {
|
}): Promise<void> => {
|
||||||
let recoverableDeletedFiles = deletedFiles
|
let recoverableDeletedFiles = deletedFiles
|
||||||
@@ -1455,7 +1453,7 @@ export const recoverDeletedFiles = async ({
|
|||||||
|
|
||||||
const submodulePath = submodulePaths.find(p => deletedFile.startsWith(p))
|
const submodulePath = submodulePaths.find(p => deletedFile.startsWith(p))
|
||||||
|
|
||||||
if (hasSubmodule && submodulePath) {
|
if (diffSubmodule && submodulePath) {
|
||||||
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
const submoduleShaResult = await gitSubmoduleDiffSHA({
|
||||||
cwd: workingDirectory,
|
cwd: workingDirectory,
|
||||||
parentSha1: diffResult.previousSha,
|
parentSha1: diffResult.previousSha,
|
||||||
|
|||||||
Reference in New Issue
Block a user