Compare commits

...

95 Commits

Author SHA1 Message Date
renovate[bot]
a29e8b5656 chore(deps): update dependency @types/node to v20.12.11 2024-05-08 13:08:12 +00:00
renovate[bot]
5a127050b2 chore(deps): update codacy/codacy-analysis-cli-action action to v4.4.1 2024-05-08 11:24:48 +00:00
renovate[bot]
581934340b chore(deps): update dependency @types/node to v20.12.10 2024-05-06 20:38:32 +00:00
renovate[bot]
5587afbef7 chore(deps): update dependency @types/node to v20.12.9 2024-05-06 16:06:25 +00:00
renovate[bot]
0f039f361b chore(deps): lock file maintenance 2024-05-06 00:55:37 +00:00
renovate[bot]
6d4230d4f0 chore(deps): update tj-actions/verify-changed-files action to v20 (#2079)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-04 17:01:00 +00:00
renovate[bot]
1711887607 chore(deps): update dependency @types/lodash to v4.17.1 2024-05-04 10:31:51 +00:00
GitHub Action
c393672835 Added missing changes and modified dist assets. 2024-05-03 21:36:59 +00:00
renovate[bot]
396e5a51d5 fix(deps): update dependency @octokit/rest to v20.1.1 2024-05-03 21:36:59 +00:00
renovate[bot]
47a2d62412 chore(deps): update dependency eslint-plugin-jest to v28.5.0 2024-05-03 21:28:22 +00:00
renovate[bot]
c73b12cc6d chore(deps): update dependency eslint-plugin-jest to v28.4.0 2024-05-03 03:20:34 +00:00
dependabot[bot]
41ce994be9 chore(deps-dev): bump @types/node from 20.12.7 to 20.12.8 (#2074)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 01:38:04 +00:00
renovate[bot]
192e174507 chore(deps): lock file maintenance 2024-05-01 13:48:00 +00:00
renovate[bot]
5e85e31a01 chore(deps): update typescript-eslint monorepo to v7.8.0 2024-04-29 19:04:36 +00:00
renovate[bot]
7871e848ad chore(deps): lock file maintenance 2024-04-29 01:36:07 +00:00
GitHub Action
15fa7fb955 Added missing changes and modified dist assets. 2024-04-28 10:28:51 +00:00
renovate[bot]
1c5b7dc5f4 fix(deps): update dependency yaml to v2.4.2 2024-04-28 10:28:51 +00:00
renovate[bot]
4765b9f775 chore(deps): update tj-actions/eslint-changed-files action to v25 (#2069)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-28 07:23:14 +00:00
tj-actions[bot]
0c82494d63 Updated README.md (#2068)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-27 10:01:05 +00:00
renovate[bot]
7d02310f6e chore(deps): update dependency eslint-plugin-jest to v28.3.0 2024-04-27 09:50:02 +00:00
renovate[bot]
0df48f8409 chore(deps): update peter-evans/create-pull-request action to v6.0.5 2024-04-25 10:44:21 +00:00
renovate[bot]
b76e23c88a chore(deps): update typescript-eslint monorepo to v7.7.1 2024-04-22 17:40:54 +00:00
renovate[bot]
549c203ec2 chore(deps): lock file maintenance 2024-04-22 01:39:30 +00:00
tj-actions[bot]
cee950d742 Updated README.md (#2061)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-20 04:26:05 +00:00
Tonye Jack
44ce9f4341 feat: reduce the default fetch_depth from 50 to 25 and increase fetch_missing_history_max_retries (#2060) 2024-04-20 04:15:07 +00:00
tj-actions[bot]
7b65c377b1 Updated README.md (#2059)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-18 15:18:18 -06:00
Tonye Jack
532b66aa5c Update action.yml 2024-04-18 15:09:11 -06:00
tj-actions[bot]
d9384bba72 Upgraded to v44.3.0 (#2058)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-18 15:07:59 -06:00
tj-actions[bot]
461ea4f9bf Updated README.md (#2057)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-18 15:04:48 -06:00
Tonye Jack
0874344d6e feat: add support for returning posix path separator on windows (#2056)
Co-authored-by: GitHub Action <action@github.com>
2024-04-18 15:03:38 -06:00
Tonye Jack
9f8300f8b4 fix: add a fallback value for the max number for retries to fetch missing history (#2055)
Co-authored-by: GitHub Action <action@github.com>
2024-04-18 19:12:36 +00:00
tj-actions[bot]
a06b9e80ae Upgraded to v44.2.0 (#2054)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-18 13:02:55 -06:00
tj-actions[bot]
4c5f5d698f Updated README.md (#2053)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-18 12:52:38 -06:00
Tonye Jack
07c64e5618 feat: add support for specifying the max number for retries to fetch missing history (#2052)
Co-authored-by: GitHub Action <action@github.com>
2024-04-18 12:45:07 -06:00
tj-actions[bot]
5bd333239b Upgraded to v44.1.0 (#2050)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-17 16:40:08 +00:00
tj-actions[bot]
831e892562 Updated README.md (#2049)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2024-04-17 10:26:15 -06:00
Tonye Jack
e052d30e1c feat: add option to exclude submodules when detecting changes (#2047)
Co-authored-by: GitHub Action <action@github.com>
2024-04-17 16:24:26 +00:00
renovate[bot]
23a449039c chore(deps): update peter-evans/create-pull-request action to v6.0.4 2024-04-17 14:08:27 +00:00
renovate[bot]
60e2739e15 chore(deps): update typescript-eslint monorepo to v7.7.0 2024-04-15 19:13:52 +00:00
renovate[bot]
0f319d7425 chore(deps): lock file maintenance 2024-04-15 03:20:08 +00:00
GitHub Action
d477ae513d Added missing changes and modified dist assets. 2024-04-15 02:12:15 +00:00
renovate[bot]
5891cbdfd5 chore(deps): lock file maintenance 2024-04-15 02:12:15 +00:00
renovate[bot]
c9eaa5c000 chore(deps): update dependency @types/micromatch to v4.0.7 2024-04-13 20:46:50 +00:00
renovate[bot]
fd91508dbb chore(deps): update peter-evans/create-pull-request action to v6.0.3 2024-04-12 11:18:54 +00:00
renovate[bot]
e8a7e82269 chore(deps): update dependency typescript to v5.4.5 2024-04-10 15:33:05 +00:00
tj-actions[bot]
159b05372c Upgraded to v44.0.1 (#2037)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-04-09 23:54:32 +00:00
renovate[bot]
635f118699 chore(deps): update dependency @types/node to v20.12.7 2024-04-09 22:45:21 +00:00
renovate[bot]
634b61511e chore(deps): update dependency @types/node to v20.12.6 2024-04-09 07:28:13 +00:00
renovate[bot]
77fcf43160 chore(deps): update typescript-eslint monorepo to v7.6.0 2024-04-08 19:14:43 +00:00
GitHub Action
5f084a52a4 Added missing changes and modified dist assets. 2024-04-08 14:42:53 +00:00
renovate[bot]
ff2cb1b4f2 chore(deps): lock file maintenance 2024-04-08 14:42:53 +00:00
renovate[bot]
5d5da31340 chore(deps): update dependency eslint-plugin-jest to v28.2.0 2024-04-07 02:26:15 +00:00
renovate[bot]
29bc0d3fd9 chore(deps): update dependency eslint-plugin-jest to v28.1.1 2024-04-06 23:12:23 +00:00
renovate[bot]
c9f9d5784e chore(deps): update dependency eslint-plugin-jest to v28 (#2030)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-06 10:04:57 +00:00
renovate[bot]
a4fba0109c chore(deps): update dependency @types/node to v20.12.5 2024-04-05 23:24:24 +00:00
dependabot[bot]
8a6546164a chore(deps): bump undici from 5.28.3 to 5.28.4 (#2026)
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>
Co-authored-by: GitHub Action <action@github.com>
2024-04-04 18:55:07 +00:00
renovate[bot]
bad2eb6859 chore(deps): update dependency typescript to v5.4.4 2024-04-04 18:45:28 +00:00
renovate[bot]
b2dbd4264a chore(deps): update dependency @types/node to v20.12.4 2024-04-04 00:49:09 +00:00
renovate[bot]
57d40e662d fix(deps): update dependency @octokit/rest to v20.1.0 2024-04-03 20:00:38 +00:00
renovate[bot]
185549c022 chore(deps): update dependency @types/node to v20.12.3 2024-04-02 22:09:40 +00:00
renovate[bot]
f853fd0592 chore(deps): update typescript-eslint monorepo to v7.5.0 2024-04-02 00:11:13 +00:00
renovate[bot]
cd3c6e6bbd chore(deps): lock file maintenance 2024-04-01 00:51:33 +00:00
renovate[bot]
e5ce44a301 chore(deps): update dependency @types/node to v20.12.2 2024-03-30 07:12:07 +00:00
renovate[bot]
ccdcd17ffd chore(deps): update tj-actions/eslint-changed-files action to v24 (#2019)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-29 14:37:20 +00:00
tj-actions[bot]
e4b8dafc5d Upgraded to v44 (#2017)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 20:33:57 -06:00
tj-actions[bot]
2d756ea4c5 Updated README.md (#2016)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 19:52:24 -06:00
tonyejack1
ce497c39e9 chore: update description of outputs removing asterisks (#2015) 2024-03-26 19:50:35 -06:00
Tonye Jack
2d21bbb405 Update README.md 2024-03-26 19:32:02 -06:00
Tonye Jack
90941b398f remove: unused code (#2014) 2024-03-26 22:49:39 +00:00
tj-actions[bot]
2ca8dc42f6 Updated README.md (#2013)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-26 16:16:41 -06:00
tonyejack1
ee096d679e chore: update description of other_deleted_files output (#2008)
Co-authored-by: Tonye Jack <jtonye@ymail.com>
2024-03-26 16:15:39 -06:00
tonyejack1
4621617d4b Update README.md 2024-03-26 13:31:35 -06:00
Tonye Jack
4bbd49b998 fix: ensure the fork remote doesn't exists before creating it (#2012)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 19:12:21 +00:00
Tonye Jack
c6557ed000 Update README.md 2024-03-26 12:50:59 -06:00
Tonye Jack
f0e7702ccc fix: update previos sha for forks (#2011)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 18:46:29 +00:00
Tonye Jack
6354e6c542 fix: update to add the fork remote (#2010) 2024-03-26 18:28:16 +00:00
Tonye Jack
117616472f fix: check for setting remote urls for forks (#2009) 2024-03-26 12:10:44 -06:00
Tonye Jack
4ff79362e5 fix: bug with prs from forks returning incorrect set of changed files (#2007)
Co-authored-by: GitHub Action <action@github.com>
2024-03-26 11:47:25 -06:00
Tonye Jack
0713a11242 Update README.md 2024-03-26 11:42:41 -06:00
renovate[bot]
064742427d chore(deps): update typescript-eslint monorepo to v7.4.0 2024-03-25 19:10:31 +00:00
renovate[bot]
efe5e6c7a4 chore(deps): lock file maintenance 2024-03-25 01:33:42 +00:00
tj-actions[bot]
01e9662a12 Upgraded to v43.0.1 (#2004)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-21 00:42:37 +00:00
renovate[bot]
20576b4b9e chore(deps): update dependency typescript to v5.4.3 2024-03-20 21:58:07 +00:00
Tonye Jack
077b23f6a6 fix: remove warning with detecting the local git repository when using Github's REST API (#2002)
Co-authored-by: GitHub Action <action@github.com>
2024-03-20 19:20:51 +00:00
Tonye Jack
02768050b1 chore: update inputs.ts adding comment about fetch_depth (#2000) 2024-03-20 14:29:59 +00:00
renovate[bot]
427adf47f0 chore(deps): update dependency @types/node to v20.11.30 2024-03-19 13:28:54 +00:00
dependabot[bot]
5c6aa49478 Bump @typescript-eslint/eslint-plugin from 7.3.0 to 7.3.1 (#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>
2024-03-18 22:27:06 -06:00
renovate[bot]
aa0b62a2d0 chore(deps): update dependency @typescript-eslint/eslint-plugin to v7.3.1 2024-03-19 02:09:15 +00:00
dependabot[bot]
0320702dd5 Bump @typescript-eslint/parser from 7.3.0 to 7.3.1 (#1996)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 01:47:18 +00:00
renovate[bot]
38903688b4 chore(deps): update dependency @types/node to v20.11.29 2024-03-18 21:43:53 +00:00
renovate[bot]
98a74d2cd6 chore(deps): update typescript-eslint monorepo to v7.3.0 2024-03-18 17:46:43 +00:00
renovate[bot]
068000d9c6 chore(deps): lock file maintenance 2024-03-18 02:16:34 +00:00
renovate[bot]
490ac3999e chore(deps): update dependency @types/node to v20.11.28 2024-03-15 10:23:14 +00:00
Tonye Jack
2859a60726 Update README.md 2024-03-13 21:43:22 -06:00
tj-actions[bot]
d03038e4e4 Upgraded to v43 (#1990)
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com>
2024-03-13 17:06:28 -06:00
21 changed files with 15058 additions and 3033 deletions

View File

@@ -34,7 +34,7 @@ jobs:
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
continue-on-error: true
uses: codacy/codacy-analysis-cli-action@v4.4.0
uses: codacy/codacy-analysis-cli-action@v4.4.1
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations

View File

@@ -37,7 +37,7 @@ jobs:
- name: Run git-cliff
uses: tj-actions/git-cliff@v1
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.0.2
uses: peter-evans/create-pull-request@v6.0.5
with:
base: "main"
labels: "merge when passing"

View File

@@ -60,7 +60,7 @@ jobs:
yarn install
- name: Run eslint on changed files
uses: tj-actions/eslint-changed-files@v23
uses: tj-actions/eslint-changed-files@v25
if: github.event_name == 'pull_request'
with:
token: ${{ secrets.PAT_TOKEN }}
@@ -72,7 +72,7 @@ jobs:
yarn all
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v19
uses: tj-actions/verify-changed-files@v20
id: changed_files
with:
files: |
@@ -682,6 +682,27 @@ jobs:
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
- name: Run changed-files excluding submodule
id: changed-files-exclude-submodule
uses: ./
with:
base_sha: "85bd869"
sha: "adde7bb"
fetch_depth: 60000
exclude_submodules: true
- name: Verify no added files
if: steps.changed-files-exclude-submodule.outputs.added_files != ''
run: |
echo "Expected: ('') got ${{ steps.changed-files-exclude-submodule.outputs.added_files }}"
exit 1
- name: Show output
run: |
echo "${{ toJSON(steps.changed-files-exclude-submodule.outputs) }}"
shell:
bash
test-yaml:
name: Test changed-files with yaml
runs-on: ubuntu-latest
@@ -988,8 +1009,11 @@ jobs:
bash
test-dir-names-deleted-files-include-only-deleted-dirs-directory:
name: Test dir names deleted files include only deleted dirs
runs-on: ubuntu-latest
runs-on: ${{ matrix.platform }}
needs: build
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
if: needs.build.outputs.files_changed != 'true'
permissions:
contents: read
@@ -997,7 +1021,7 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: cd1e384723e4d1a184568182ac2b27c53ebf017f
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: true
fetch-depth: 2
@@ -1009,6 +1033,7 @@ jobs:
sha: cd1e384723e4d1a184568182ac2b27c53ebf017f
dir_names: true
dir_names_deleted_files_include_only_deleted_dirs: true
fetch_depth: 60000
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-deleted-files-include-only-deleted-dirs-directory.outputs) }}'
@@ -1028,6 +1053,35 @@ jobs:
exit 1
shell:
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:
name: Test changed-files since last remote commit

View File

@@ -27,7 +27,7 @@ jobs:
uses: tj-actions/remark@v3
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v19
uses: tj-actions/verify-changed-files@v20
id: verify_changed_files
with:
files: |

View File

@@ -1,5 +1,212 @@
# Changelog
# [44.3.0](https://github.com/tj-actions/changed-files/compare/v44.2.0...v44.3.0) - (2024-04-18)
## <!-- 0 -->🚀 Features
- Add support for returning posix path separator on windows ([#2056](https://github.com/tj-actions/changed-files/issues/2056)) ([0874344](https://github.com/tj-actions/changed-files/commit/0874344d6ebbaa00a27da73276ae7162fadcaf69)) - (Tonye Jack)
## <!-- 1 -->🐛 Bug Fixes
- Add a fallback value for the max number for retries to fetch missing history ([#2055](https://github.com/tj-actions/changed-files/issues/2055)) ([9f8300f](https://github.com/tj-actions/changed-files/commit/9f8300f8b45b8ddd3009f170957adfa5db4f3d5d)) - (Tonye Jack)
## <!-- 9 -->⬆️ Upgrades
- Upgraded to v44.2.0 ([#2054](https://github.com/tj-actions/changed-files/issues/2054))
Co-authored-by: jackton1 <17484350+jackton1@users.noreply.github.com> ([a06b9e8](https://github.com/tj-actions/changed-files/commit/a06b9e80ae631cf6747b0ed4362a83f773ffaa40)) - (tj-actions[bot])
# [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)
## <!-- 0 -->🚀 Features

364
README.md
View File

@@ -116,15 +116,13 @@ jobs:
name: Test changed-files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
# -----------------------------------------------------------------------------------------------------------
# Example 1
# -----------------------------------------------------------------------------------------------------------
- name: Get 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
# with:
# since_last_remote_commit: true
@@ -142,7 +140,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get all changed markdown files
id: changed-markdown-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
# Avoid using single or double quotes for multiline patterns
files: |
@@ -162,7 +160,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files_yaml: |
doc:
@@ -197,7 +195,7 @@ jobs:
# -----------------------------------------------------------------------------------------------------------
- name: Get changed files in the docs folder
id: changed-files-specific
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files: docs/*.{js,html} # Alternatively using: `docs/**`
files_ignore: docs/static.js
@@ -229,7 +227,7 @@ jobs:
# NOTE:
# - This is limited to pull_request* events and would raise an error for other events.
# - 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
name: Test changed-files
@@ -239,7 +237,7 @@ jobs:
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
- name: List all changed files
env:
@@ -282,7 +280,7 @@ jobs:
- name: Get 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.
- name: List all changed files
@@ -322,14 +320,14 @@ Support this project with a :star:
> * When using `files_yaml*` inputs:
> * 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 ⚙️
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
```yaml
- uses: tj-actions/changed-files@v42
- uses: tj-actions/changed-files@v44
id: changed-files
with:
# Github API URL.
@@ -337,52 +335,68 @@ Support this project with a :star:
# Default: "${{ github.api_url }}"
api_url: ''
# Specify a different base commit SHA or branch used
# for comparing changes
# Specify a different base commit
# SHA or branch used for
# comparing changes
# Type: string
base_sha: ''
# Exclude changes outside the current directory and show path
# names relative to it. NOTE: This requires you to
# specify the top-level directory via the `path` input.
# Exclude changes outside the current
# directory and show path names
# relative to it. NOTE: This
# requires you to specify the
# top-level directory via the `path`
# input.
# Type: boolean
# Default: "true"
diff_relative: ''
# Output unique changed directories instead of filenames. NOTE: This
# returns `.` for changed files located in the current
# working directory which defaults to `$GITHUB_WORKSPACE`.
# Output unique changed directories instead
# of filenames. NOTE: This returns
# `.` for changed files located
# in the current working directory
# which defaults to `$GITHUB_WORKSPACE`.
# Type: boolean
# Default: "false"
dir_names: ''
# Include only directories that have been deleted as opposed
# to directory names of files that have been deleted
# in the `deleted_files` output when `dir_names` is set to
# `true`.
# Include only directories that have
# been deleted as opposed to
# directory names of files that
# have been deleted in the
# `deleted_files` output when `dir_names` is
# set to `true`.
# Type: boolean
# Default: "false"
dir_names_deleted_files_include_only_deleted_dirs: ''
# Exclude the current directory represented by `.` from the
# output when `dir_names` is set to `true`.
# Exclude the current directory represented
# by `.` from the output
# when `dir_names` is set to
# `true`.
# Type: boolean
# Default: "false"
dir_names_exclude_current_dir: ''
# File and directory patterns to include in the output
# when `dir_names` is set to `true`. NOTE: This returns
# only the matching files and also the directory names.
# File and directory patterns to
# include in the output when
# `dir_names` is set to `true`.
# NOTE: This returns only the
# matching files and also the
# directory names.
# Type: string
dir_names_include_files: ''
# Separator used to split the `dir_names_include_files` input
# Separator used to split the
# `dir_names_include_files` input
# Type: string
# Default: "\n"
dir_names_include_files_separator: ''
# Limit the directory output to a maximum depth e.g
# `test/test1/test2` with max depth of `2` returns `test/test1`.
# Limit the directory output to
# a maximum depth e.g `test/test1/test2`
# with max depth of `2`
# returns `test/test1`.
# Type: string
dir_names_max_depth: ''
@@ -391,12 +405,19 @@ Support this project with a :star:
# Default: "true"
escape_json: ''
# Fail when the initial diff fails.
# Exclude changes to submodules.
# Type: boolean
# Default: "false"
exclude_submodules: ''
# Fail when the initial diff
# fails.
# Type: boolean
# Default: "false"
fail_on_initial_diff_error: ''
# Fail when the submodule diff fails.
# Fail when the submodule diff
# fails.
# Type: boolean
# Default: "false"
fail_on_submodule_diff_error: ''
@@ -406,112 +427,140 @@ Support this project with a :star:
# Default: "false"
fetch_additional_submodule_history: ''
# Depth of additional branch history fetched. NOTE: This can
# be adjusted to resolve errors with insufficient history.
# Depth of additional branch history
# fetched. NOTE: This can be
# adjusted to resolve errors with
# insufficient history.
# Type: string
# Default: "50"
# Default: "25"
fetch_depth: ''
# File and directory patterns used to detect changes (Defaults to the entire repo if unset).
# NOTE: Multiline file/directory patterns should not include quotes.
# Maximum number of retries to
# fetch missing history.
# Type: string
# Default: "20"
fetch_missing_history_max_retries: ''
# File and directory patterns used
# to detect changes (Defaults to the entire repo if unset). NOTE:
# Multiline file/directory patterns should not
# include quotes.
# Type: string
files: ''
# Source file(s) used to populate the `files` input.
# Source file(s) used to populate
# the `files` input.
# Type: string
files_from_source_file: ''
# Separator used to split the `files_from_source_file` input.
# Separator used to split the
# `files_from_source_file` input.
# Type: string
# Default: "\n"
files_from_source_file_separator: ''
# Ignore changes to these file(s). NOTE: Multiline file/directory patterns
# should not include quotes.
# Ignore changes to these file(s).
# NOTE: Multiline file/directory patterns should
# not include quotes.
# Type: string
files_ignore: ''
# Source file(s) used to populate the `files_ignore` input
# Source file(s) used to populate
# the `files_ignore` input
# Type: string
files_ignore_from_source_file: ''
# Separator used to split the `files_ignore_from_source_file` input
# Separator used to split the
# `files_ignore_from_source_file` input
# Type: string
# Default: "\n"
files_ignore_from_source_file_separator: ''
# Separator used to split the `files_ignore` input
# Separator used to split the
# `files_ignore` input
# Type: string
# Default: "\n"
files_ignore_separator: ''
# YAML used to define a set of file patterns
# to ignore changes
# YAML used to define a
# set of file patterns to
# ignore changes
# Type: string
files_ignore_yaml: ''
# Source file(s) used to populate the `files_ignore_yaml` input. Example:
# https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
# Source file(s) used to populate
# the `files_ignore_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
# Type: string
files_ignore_yaml_from_source_file: ''
# Separator used to split the `files_ignore_yaml_from_source_file` input
# Separator used to split the
# `files_ignore_yaml_from_source_file` input
# Type: string
# Default: "\n"
files_ignore_yaml_from_source_file_separator: ''
# Separator used to split the `files` input
# Separator used to split the
# `files` input
# Type: string
# Default: "\n"
files_separator: ''
# YAML used to define a set of file patterns
# to detect changes
# YAML used to define a
# set of file patterns to
# detect changes
# Type: string
files_yaml: ''
# Source file(s) used to populate the `files_yaml` input. Example:
# https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
# Source file(s) used to populate
# the `files_yaml` input. Example: https://github.com/tj-actions/changed-files/blob/main/test/changed-files.yml
# Type: string
files_yaml_from_source_file: ''
# Separator used to split the `files_yaml_from_source_file` input
# Separator used to split the
# `files_yaml_from_source_file` input
# Type: string
# Default: "\n"
files_yaml_from_source_file_separator: ''
# Include `all_old_new_renamed_files` output. Note this can generate a large
# output See: #501.
# Include `all_old_new_renamed_files` output. Note this
# can generate a large output
# See: #501.
# Type: boolean
# Default: "false"
include_all_old_new_renamed_files: ''
# Output list of changed files in a JSON formatted
# string which can be used for matrix jobs. Example:
# https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.yml
# Output list of changed files
# in a JSON formatted string
# which can be used for
# matrix jobs. Example: https://github.com/tj-actions/changed-files/blob/main/.github/workflows/matrix-example.yml
# Type: boolean
# Default: "false"
json: ''
# 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`.
# 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`.
# Type: boolean
# Default: "false"
matrix: ''
# Apply the negation patterns first. NOTE: This affects how
# changed files are matched.
# Apply the negation patterns first.
# NOTE: This affects how changed
# files are matched.
# Type: boolean
# Default: "false"
negation_patterns_first: ''
# Split character for old and new renamed filename pairs.
# Split character for old and
# new renamed filename pairs.
# Type: string
# Default: " "
old_new_files_separator: ''
# Split character for old and new filename pairs.
# Split character for old and
# new filename pairs.
# Type: string
# Default: ","
old_new_separator: ''
@@ -521,19 +570,22 @@ Support this project with a :star:
# Default: ".github/outputs"
output_dir: ''
# Output renamed files as deleted and added files.
# Output renamed files as deleted
# and added files.
# Type: boolean
# Default: "false"
output_renamed_files_as_deleted_and_added: ''
# Specify a relative path under `$GITHUB_WORKSPACE` to locate the
# repository.
# Specify a relative path under
# `$GITHUB_WORKSPACE` to locate the repository.
# Type: string
# Default: "."
path: ''
# Use non-ASCII characters to match files and output the
# filenames completely verbatim by setting this to `false`
# Use non-ASCII characters to match
# files and output the filenames
# completely verbatim by setting this
# to `false`
# Type: boolean
# Default: "true"
quotepath: ''
@@ -543,35 +595,41 @@ Support this project with a :star:
# Default: "false"
recover_deleted_files: ''
# Recover deleted files to a new destination directory, defaults
# to the original location.
# Recover deleted files to a
# new destination directory, defaults to
# the original location.
# Type: string
recover_deleted_files_to_destination: ''
# File and directory patterns used to recover deleted files,
# defaults to the patterns provided via the `files`, `files_from_source_file`,
# `files_ignore` and `files_ignore_from_source_file` inputs or all deleted files if
# no patterns are provided.
# File and directory patterns used
# to recover deleted files, defaults
# to the patterns provided via
# the `files`, `files_from_source_file`, `files_ignore` and
# `files_ignore_from_source_file` inputs or all deleted
# files if no patterns are
# provided.
# Type: string
recover_files: ''
# File and directory patterns to ignore when recovering deleted
# files.
# File and directory patterns to
# ignore when recovering deleted files.
# Type: string
recover_files_ignore: ''
# Separator used to split the `recover_files_ignore` input
# Separator used to split the
# `recover_files_ignore` input
# Type: string
# Default: "\n"
recover_files_ignore_separator: ''
# Separator used to split the `recover_files` input
# Separator used to split the
# `recover_files` input
# Type: string
# Default: "\n"
recover_files_separator: ''
# Apply sanitization to output filenames before being set as
# output.
# Apply sanitization to output filenames
# before being set as output.
# Type: boolean
# Default: "true"
safe_output: ''
@@ -581,53 +639,74 @@ Support this project with a :star:
# Default: " "
separator: ''
# Specify a different commit SHA or branch used for
# comparing changes
# Specify a different commit SHA
# or branch used for comparing
# changes
# Type: string
sha: ''
# Get changed files for commits whose timestamp is older
# than the given time.
# Get changed files for commits
# whose timestamp is older than
# the given time.
# Type: string
since: ''
# Use the last commit on the remote branch as
# the `base_sha`. Defaults to the last non-merge commit on
# the target branch for pull request events and the
# previous remote commit of the current branch for push
# events.
# Use the last commit on
# the remote branch as the
# `base_sha`. Defaults to the last
# non-merge commit on the target
# branch for pull request events
# and the previous remote commit
# of the current branch for
# push events.
# Type: boolean
# Default: "false"
since_last_remote_commit: ''
# Skip initially fetching additional history to improve performance for
# shallow repositories. NOTE: This could lead to errors with
# missing history. It's intended to be used when you've
# fetched all necessary history to perform the diff.
# Skip initially fetching additional history
# to improve performance for shallow
# repositories. NOTE: This could lead
# to errors with missing history.
# It's intended to be used
# when you've fetched all necessary
# history to perform the diff.
# Type: boolean
# Default: "false"
skip_initial_fetch: ''
# GitHub token used to fetch changed files from Github's
# API.
# GitHub token used to fetch
# changed files from Github's API.
# Type: string
# Default: "${{ github.token }}"
token: ''
# Get changed files for commits whose timestamp is earlier
# than the given time.
# Get changed files for commits
# whose timestamp is earlier than
# the given time.
# Type: string
until: ''
# Force the use of Github's REST API even when
# a local copy of the repository exists
# Use POSIX path separator `/`
# for output file paths on
# Windows.
# Type: boolean
# Default: "false"
use_posix_path_separator: ''
# Force the use of Github's
# REST API even when a
# local copy of the repository
# exists
# Type: boolean
# Default: "false"
use_rest_api: ''
# Write outputs to the `output_dir` defaults to `.github/outputs` folder.
# NOTE: This creates a `.txt` file by default and
# a `.json` file if `json` is set to `true`.
# Write outputs to the `output_dir`
# defaults to `.github/outputs` folder. NOTE:
# This creates a `.txt` file
# by default and a `.json`
# file if `json` is set
# to `true`.
# Type: boolean
# Default: "false"
write_output_files: ''
@@ -664,33 +743,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_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_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_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_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_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_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_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_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_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_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_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_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_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_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` |
@@ -724,7 +803,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
...
```
@@ -737,7 +816,7 @@ The format of the version string is as follows:
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
safe_output: false # set to false because we are using an environment variable to store the output and avoid command injection.
@@ -760,7 +839,7 @@ The format of the version string is as follows:
...
- name: Get all changed files and use a comma separator in the output
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
separator: ","
...
@@ -777,7 +856,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
- name: List all added files
env:
@@ -800,7 +879,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get 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
if: contains(steps.changed-files.outputs.modified_files, 'my-file.txt')
@@ -821,7 +900,7 @@ See [outputs](#outputs) for a list of all available outputs.
- name: Get changed files and write the outputs to a Txt file
id: changed-files-write-output-files-txt
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
write_output_files: true
@@ -840,7 +919,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
json: true
write_output_files: true
@@ -860,7 +939,7 @@ See [outputs](#outputs) for a list of all available outputs.
...
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files: |
my-file.txt
@@ -883,7 +962,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files: |
my-file.txt
@@ -934,7 +1013,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.
id: changed-files-specific-source-file
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files_from_source_file: test/changed-files-list.txt
...
@@ -951,7 +1030,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.
id: changed-files-specific-source-file-and-specify-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files_from_source_file: |
test/changed-files-list.txt
@@ -972,7 +1051,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different SHA
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
sha: ${{ github.event.pull_request.head.sha }}
...
@@ -989,7 +1068,7 @@ See [inputs](#inputs) for more information.
...
- name: Get changed files using a different base SHA
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
base_sha: ${{ github.event.pull_request.base.sha }}
...
@@ -1021,7 +1100,7 @@ jobs:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
- name: List changed files
env:
@@ -1031,7 +1110,7 @@ jobs:
- name: Get changed files in the .github folder
id: changed-files-specific
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files: .github/**
@@ -1062,14 +1141,13 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with defaults in dir1
id: changed-files-for-dir1
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
path: dir1
- name: List all added files in dir1
env:
ADDED_FILES: |-
${{ steps.changed-files-for-dir1.outputs.added_files }}
ADDED_FILES: ${{ steps.changed-files-for-dir1.outputs.added_files }}
run: |
for file in ${ADDED_FILES}; do
echo "$file was added"
@@ -1088,13 +1166,13 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with quotepath disabled
id: changed-files-quotepath
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
quotepath: "false"
- name: Run changed-files with quotepath disabled for a specified list of file(s)
id: changed-files-quotepath-specific
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
files: test/test-è.txt
quotepath: "false"
@@ -1127,7 +1205,7 @@ See [inputs](#inputs) for more information.
- name: Run changed-files with the commit of the last successful test workflow run
id: changed-files-base-sha-push
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
@@ -1154,7 +1232,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
id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
@@ -1180,7 +1258,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with dir_names
id: changed-files-dir-names
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
dir_names: "true"
...
@@ -1197,7 +1275,7 @@ See [inputs](#inputs) for more information.
...
- name: Run changed-files with JSON output
id: changed-files-json
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
json: "true"
...
@@ -1214,13 +1292,13 @@ See [inputs](#inputs) for more information.
...
- name: Get changed-files since 2022-08-19
id: changed-files-since
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
since: "2022-08-19"
- name: Get changed-files until 2022-08-20
id: changed-files-until
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v44
with:
until: "2022-08-20"
...
@@ -1252,7 +1330,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)
* [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)
@@ -1309,7 +1387,7 @@ Report bugs at https://github.com/tj-actions/changed-files/issues.
If you are reporting a bug, please include:
* 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.
## Contributors ✨

View File

@@ -141,7 +141,7 @@ inputs:
fetch_depth:
description: "Depth of additional branch history fetched. NOTE: This can be adjusted to resolve errors with insufficient history."
required: false
default: "50"
default: "25"
skip_initial_fetch:
description: |
Skip initially fetching additional history to improve performance for shallow repositories.
@@ -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`."
required: 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: "20"
use_posix_path_separator:
description: "Use POSIX path separator `/` for output file paths on Windows."
required: false
default: "false"
outputs:
added_files:
@@ -262,11 +274,11 @@ outputs:
unknown_files_count:
description: "Returns the number of `unknown_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:
description: "Returns the number of `all_changed_and_modified_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:
description: "Returns the number of `all_changed_files`"
any_changed:
@@ -274,11 +286,11 @@ outputs:
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)*."
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:
description: "Returns the number of `other_changed_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:
description: "Returns the number of `all_modified_files`"
any_modified:
@@ -286,7 +298,7 @@ outputs:
only_modified:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been modified. (ACMRD)."
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:
description: "Returns the number of `other_modified_files`"
any_deleted:
@@ -294,13 +306,13 @@ outputs:
only_deleted:
description: "Returns `true` when only files provided using the `files*` or `files_ignore*` inputs have been deleted. (D)"
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:
description: "Returns the number of `other_deleted_files`"
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:
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:
using: 'node20'

10627
dist/index.js generated vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

5249
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@tj-actions/changed-files",
"version": "42.1.0",
"version": "44.3.0",
"description": "Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.",
"main": "lib/main.js",
"publishConfig": {
@@ -14,6 +14,7 @@
"lint:fix": "eslint --fix src/*.ts src/**/*.ts",
"package": "ncc build lib/main.js --source-map --license licenses.txt",
"test": "jest --coverage",
"update-snapshot": "jest -u",
"all": "yarn build && yarn format && yarn lint && yarn package && yarn test"
},
"repository": {
@@ -36,6 +37,7 @@
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@octokit/rest": "^20.0.1",
"@stdlib/utils-convert-path": "^0.2.1",
"lodash": "^4.17.21",
"micromatch": "^4.0.5",
"yaml": "^2.3.1"
@@ -50,10 +52,10 @@
"@typescript-eslint/parser": "^7.0.0",
"@vercel/ncc": "^0.38.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-plugin-github": "^4.8.0",
"eslint-plugin-jest": "^28.0.0",
"eslint-plugin-prettier": "^5.0.0-alpha.2",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"ts-jest": "^29.1.0",

View File

@@ -2,55 +2,60 @@
exports[`getInputs should correctly parse boolean inputs 1`] = `
{
"apiUrl": undefined,
"baseSha": undefined,
"apiUrl": "",
"baseSha": "",
"diffRelative": "false",
"dirNames": "false",
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": "false",
"dirNamesExcludeCurrentDir": "false",
"dirNamesIncludeFiles": undefined,
"dirNamesIncludeFilesSeparator": undefined,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"escapeJson": false,
"excludeSubmodules": "false",
"failOnInitialDiffError": "false",
"failOnSubmoduleDiffError": "false",
"fetchAdditionalSubmoduleHistory": "false",
"files": undefined,
"filesFromSourceFile": undefined,
"filesFromSourceFileSeparator": undefined,
"filesIgnore": undefined,
"filesIgnoreFromSourceFile": undefined,
"filesIgnoreFromSourceFileSeparator": undefined,
"filesIgnoreSeparator": undefined,
"filesIgnoreYaml": undefined,
"filesIgnoreYamlFromSourceFile": undefined,
"filesIgnoreYamlFromSourceFileSeparator": undefined,
"filesSeparator": undefined,
"filesYaml": undefined,
"filesYamlFromSourceFile": undefined,
"filesYamlFromSourceFileSeparator": undefined,
"fetchMissingHistoryMaxRetries": 10,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": "false",
"json": true,
"negationPatternsFirst": "false",
"oldNewFilesSeparator": undefined,
"oldNewSeparator": undefined,
"outputDir": undefined,
"oldNewFilesSeparator": " ",
"oldNewSeparator": ",",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": "false",
"path": undefined,
"path": ".",
"quotepath": "false",
"recoverDeletedFiles": "false",
"recoverDeletedFilesToDestination": undefined,
"recoverFiles": undefined,
"recoverFilesIgnore": undefined,
"recoverFilesIgnoreSeparator": undefined,
"recoverFilesSeparator": undefined,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "
",
"recoverFilesSeparator": "
",
"safeOutput": "false",
"separator": undefined,
"sha": undefined,
"since": undefined,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": "false",
"skipInitialFetch": "true",
"token": undefined,
"until": undefined,
"token": "",
"until": "",
"usePosixPathSeparator": "false",
"useRestApi": "false",
"writeOutputFiles": "false",
}
@@ -68,6 +73,7 @@ exports[`getInputs should correctly parse numeric inputs 1`] = `
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": 2,
"escapeJson": false,
"excludeSubmodules": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
@@ -109,6 +115,7 @@ exports[`getInputs should correctly parse numeric inputs 1`] = `
"skipInitialFetch": false,
"token": "",
"until": "",
"usePosixPathSeparator": false,
"useRestApi": false,
"writeOutputFiles": false,
}
@@ -125,6 +132,7 @@ exports[`getInputs should correctly parse string inputs 1`] = `
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"escapeJson": false,
"excludeSubmodules": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
@@ -165,6 +173,7 @@ exports[`getInputs should correctly parse string inputs 1`] = `
"skipInitialFetch": false,
"token": "token",
"until": "",
"usePosixPathSeparator": false,
"useRestApi": false,
"writeOutputFiles": false,
}
@@ -182,6 +191,7 @@ exports[`getInputs should handle invalid numeric inputs correctly 1`] = `
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": 2,
"escapeJson": false,
"excludeSubmodules": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
@@ -223,6 +233,7 @@ exports[`getInputs should handle invalid numeric inputs correctly 1`] = `
"skipInitialFetch": false,
"token": "",
"until": "",
"usePosixPathSeparator": false,
"useRestApi": false,
"writeOutputFiles": false,
}
@@ -240,6 +251,7 @@ exports[`getInputs should handle negative numeric inputs correctly 1`] = `
"dirNamesIncludeFilesSeparator": "",
"dirNamesMaxDepth": -2,
"escapeJson": false,
"excludeSubmodules": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
@@ -281,6 +293,7 @@ exports[`getInputs should handle negative numeric inputs correctly 1`] = `
"skipInitialFetch": false,
"token": "",
"until": "",
"usePosixPathSeparator": false,
"useRestApi": 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`] = `
{
"apiUrl": undefined,
"baseSha": undefined,
"apiUrl": "",
"baseSha": "",
"diffRelative": true,
"dirNames": false,
"dirNamesDeletedFilesIncludeOnlyDeletedDirs": false,
"dirNamesExcludeCurrentDir": false,
"dirNamesIncludeFiles": undefined,
"dirNamesIncludeFilesSeparator": undefined,
"dirNamesIncludeFiles": "",
"dirNamesIncludeFilesSeparator": "",
"escapeJson": false,
"excludeSubmodules": false,
"failOnInitialDiffError": false,
"failOnSubmoduleDiffError": false,
"fetchAdditionalSubmoduleHistory": false,
"files": undefined,
"filesFromSourceFile": undefined,
"filesFromSourceFileSeparator": undefined,
"filesIgnore": undefined,
"filesIgnoreFromSourceFile": undefined,
"filesIgnoreFromSourceFileSeparator": undefined,
"filesIgnoreSeparator": undefined,
"filesIgnoreYaml": undefined,
"filesIgnoreYamlFromSourceFile": undefined,
"filesIgnoreYamlFromSourceFileSeparator": undefined,
"filesSeparator": undefined,
"filesYaml": undefined,
"filesYamlFromSourceFile": undefined,
"filesYamlFromSourceFileSeparator": undefined,
"fetchMissingHistoryMaxRetries": 10,
"files": "",
"filesFromSourceFile": "",
"filesFromSourceFileSeparator": "",
"filesIgnore": "",
"filesIgnoreFromSourceFile": "",
"filesIgnoreFromSourceFileSeparator": "",
"filesIgnoreSeparator": "",
"filesIgnoreYaml": "",
"filesIgnoreYamlFromSourceFile": "",
"filesIgnoreYamlFromSourceFileSeparator": "",
"filesSeparator": "",
"filesYaml": "",
"filesYamlFromSourceFile": "",
"filesYamlFromSourceFileSeparator": "",
"includeAllOldNewRenamedFiles": false,
"json": false,
"negationPatternsFirst": false,
"oldNewFilesSeparator": undefined,
"oldNewSeparator": undefined,
"outputDir": undefined,
"oldNewFilesSeparator": " ",
"oldNewSeparator": ",",
"outputDir": "",
"outputRenamedFilesAsDeletedAndAdded": false,
"path": undefined,
"path": ".",
"quotepath": true,
"recoverDeletedFiles": false,
"recoverDeletedFilesToDestination": undefined,
"recoverFiles": undefined,
"recoverFilesIgnore": undefined,
"recoverFilesIgnoreSeparator": undefined,
"recoverFilesSeparator": undefined,
"recoverDeletedFilesToDestination": "",
"recoverFiles": "",
"recoverFilesIgnore": "",
"recoverFilesIgnoreSeparator": "
",
"recoverFilesSeparator": "
",
"safeOutput": false,
"separator": undefined,
"sha": undefined,
"since": undefined,
"separator": "",
"sha": "",
"since": "",
"sinceLastRemoteCommit": false,
"skipInitialFetch": false,
"token": undefined,
"until": undefined,
"token": "",
"until": "",
"usePosixPathSeparator": false,
"useRestApi": false,
"writeOutputFiles": false,
}

View File

@@ -10,7 +10,7 @@ describe('getInputs', () => {
})
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[]) => {
return g[1].toUpperCase()
}) as keyof Inputs
@@ -30,7 +30,7 @@ describe('getInputs', () => {
})
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[]) => {
return g[1].toUpperCase()
}) as keyof Inputs

View File

@@ -635,7 +635,10 @@ describe('utils test', () => {
failOnInitialDiffError: false,
failOnSubmoduleDiffError: false,
negationPatternsFirst: false,
useRestApi: false
useRestApi: false,
excludeSubmodules: false,
fetchMissingHistoryMaxRetries: 10,
usePosixPathSeparator: false
}
const coreWarningSpy = jest.spyOn(core, 'warning')

View File

@@ -2,6 +2,7 @@ import * as core from '@actions/core'
import * as github from '@actions/github'
import type {RestEndpointMethodTypes} from '@octokit/rest'
import flatten from 'lodash/flatten'
import convertPath from '@stdlib/utils-convert-path'
import mm from 'micromatch'
import * as path from 'path'
import {setOutputsAndGetModifiedAndChangedFilesStatus} from './changedFilesOutput'
@@ -121,13 +122,13 @@ export const processChangedFiles = async ({
export const getRenamedFiles = async ({
inputs,
workingDirectory,
hasSubmodule,
diffSubmodule,
diffResult,
submodulePaths
}: {
inputs: Inputs
workingDirectory: string
hasSubmodule: boolean
diffSubmodule: boolean
diffResult: DiffResult
submodulePaths: string[]
}): Promise<{paths: string; count: string}> => {
@@ -139,7 +140,7 @@ export const getRenamedFiles = async ({
oldNewSeparator: inputs.oldNewSeparator
})
if (hasSubmodule) {
if (diffSubmodule) {
for (const submodulePath of submodulePaths) {
const submoduleShaResult = await gitSubmoduleDiffSHA({
cwd: workingDirectory,
@@ -217,7 +218,7 @@ export type ChangedFiles = {
export const getAllDiffFiles = async ({
workingDirectory,
hasSubmodule,
diffSubmodule,
diffResult,
submodulePaths,
outputRenamedFilesAsDeletedAndAdded,
@@ -226,7 +227,7 @@ export const getAllDiffFiles = async ({
failOnSubmoduleDiffError
}: {
workingDirectory: string
hasSubmodule: boolean
diffSubmodule: boolean
diffResult: DiffResult
submodulePaths: string[]
outputRenamedFilesAsDeletedAndAdded: boolean
@@ -243,7 +244,7 @@ export const getAllDiffFiles = async ({
failOnInitialDiffError
})
if (hasSubmodule) {
if (diffSubmodule) {
for (const submodulePath of submodulePaths) {
const submoduleShaResult = await gitSubmoduleDiffSHA({
cwd: workingDirectory,
@@ -355,7 +356,11 @@ function* getChangeTypeFilesGenerator({
filePaths,
dirNamesIncludeFilePatterns
})) {
yield filePath
if (isWindows() && inputs.usePosixPathSeparator) {
yield convertPath(filePath, 'mixed')
} else {
yield filePath
}
}
}
}
@@ -402,7 +407,11 @@ function* getAllChangeTypeFilesGenerator({
filePaths,
dirNamesIncludeFilePatterns
})) {
yield filePath
if (isWindows() && inputs.usePosixPathSeparator) {
yield convertPath(filePath, 'mixed')
} else {
yield filePath
}
}
}

View File

@@ -86,15 +86,27 @@ export interface DiffResult {
initialCommit?: boolean
}
export const getSHAForNonPullRequestEvent = async (
inputs: Inputs,
env: Env,
workingDirectory: string,
isShallow: boolean,
hasSubmodule: boolean,
gitFetchExtraArgs: string[],
interface SHAForNonPullRequestEvent {
inputs: Inputs
env: Env
workingDirectory: string
isShallow: boolean
diffSubmodule: boolean
gitFetchExtraArgs: string[]
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 currentBranch = targetBranch
let initialCommit = false
@@ -122,8 +134,8 @@ export const getSHAForNonPullRequestEvent = async (
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${sourceBranch}:refs/remotes/origin/${sourceBranch}`
remoteName,
`+refs/heads/${sourceBranch}:refs/remotes/${remoteName}/${sourceBranch}`
]
})
} else {
@@ -134,13 +146,13 @@ export const getSHAForNonPullRequestEvent = async (
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
remoteName,
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
]
})
}
if (hasSubmodule) {
if (diffSubmodule) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
@@ -152,7 +164,7 @@ export const getSHAForNonPullRequestEvent = async (
})
}
} else {
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
@@ -307,14 +319,23 @@ export const getSHAForNonPullRequestEvent = async (
}
}
export const getSHAForPullRequestEvent = async (
inputs: Inputs,
env: Env,
workingDirectory: string,
isShallow: boolean,
hasSubmodule: boolean,
interface SHAForPullRequestEvent {
inputs: Inputs
workingDirectory: string
isShallow: boolean
diffSubmodule: boolean
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
const currentBranch = github.context.payload.pull_request?.head?.ref
if (inputs.sinceLastRemoteCommit) {
@@ -330,7 +351,7 @@ export const getSHAForPullRequestEvent = async (
...gitFetchExtraArgs,
'-u',
'--progress',
'origin',
remoteName,
`pull/${github.context.payload.pull_request?.number}/head:${currentBranch}`
]
})
@@ -343,8 +364,8 @@ export const getSHAForPullRequestEvent = async (
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${currentBranch}*:refs/remotes/origin/${currentBranch}*`
remoteName,
`+refs/heads/${currentBranch}*:refs/remotes/${remoteName}/${currentBranch}*`
]
})
}
@@ -364,12 +385,12 @@ export const getSHAForPullRequestEvent = async (
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
remoteName,
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
]
})
if (hasSubmodule) {
if (diffSubmodule) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
@@ -382,7 +403,7 @@ export const getSHAForPullRequestEvent = async (
}
}
} else {
if (hasSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
if (diffSubmodule && inputs.fetchAdditionalSubmoduleHistory) {
await gitFetchSubmodules({
cwd: workingDirectory,
args: [
@@ -427,10 +448,7 @@ export const getSHAForPullRequestEvent = async (
}
}
if (
!github.context.payload.pull_request?.base?.ref ||
github.context.payload.pull_request?.head?.repo?.fork === true
) {
if (!github.context.payload.pull_request?.base?.ref) {
diff = '..'
}
@@ -487,17 +505,14 @@ export const getSHAForPullRequestEvent = async (
}
}
} else {
if (github.context.payload.action === 'closed') {
previousSha = github.context.payload.pull_request?.base?.sha
} else {
previousSha = github.context.payload.pull_request?.base?.sha
if (!previousSha) {
previousSha = await getRemoteBranchHeadSha({
cwd: workingDirectory,
remoteName,
branch: targetBranch
})
if (!previousSha) {
previousSha = github.context.payload.pull_request?.base?.sha
}
}
if (isShallow) {
@@ -513,7 +528,11 @@ export const getSHAForPullRequestEvent = async (
'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({
cwd: workingDirectory,
args: [
@@ -521,8 +540,8 @@ export const getSHAForPullRequestEvent = async (
'-u',
'--progress',
`--deepen=${inputs.fetchDepth}`,
'origin',
`+refs/heads/${targetBranch}:refs/remotes/origin/${targetBranch}`
remoteName,
`+refs/heads/${targetBranch}:refs/remotes/${remoteName}/${targetBranch}`
]
})

View File

@@ -20,5 +20,8 @@ export const DEFAULT_VALUES_OF_UNSUPPORTED_API_INPUTS: Partial<Inputs> = {
oldNewFilesSeparator: ' ',
skipInitialFetch: false,
fetchAdditionalSubmoduleHistory: false,
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false
dirNamesDeletedFilesIncludeOnlyDeletedDirs: false,
excludeSubmodules: false,
fetchMissingHistoryMaxRetries: 10,
usePosixPathSeparator: false
}

View File

@@ -54,6 +54,9 @@ export type Inputs = {
failOnSubmoduleDiffError: boolean
negationPatternsFirst: boolean
useRestApi: boolean
excludeSubmodules: boolean
fetchMissingHistoryMaxRetries?: number
usePosixPathSeparator: boolean
}
export const getInputs = (): Inputs => {
@@ -240,6 +243,22 @@ export const getInputs = (): Inputs => {
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 = {
files,
filesSeparator,
@@ -279,6 +298,8 @@ export const getInputs = (): Inputs => {
skipInitialFetch,
fetchAdditionalSubmoduleHistory,
dirNamesDeletedFilesIncludeOnlyDeletedDirs,
excludeSubmodules,
usePosixPathSeparator,
// End Not Supported via REST API
dirNames,
dirNamesExcludeCurrentDir,
@@ -297,6 +318,7 @@ export const getInputs = (): Inputs => {
}
if (fetchDepth) {
// Fallback to at least 2 if the fetch_depth is less than 2
inputs.fetchDepth = Math.max(parseInt(fetchDepth, 10), 2)
}
@@ -304,5 +326,13 @@ export const getInputs = (): Inputs => {
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
}

View File

@@ -64,14 +64,26 @@ const getChangedFilesFromLocalGitHistory = async ({
}
const isShallow = await isRepoShallow({cwd: workingDirectory})
const hasSubmodule = await submoduleExists({cwd: workingDirectory})
let gitFetchExtraArgs = ['--no-tags', '--prune', '--recurse-submodules']
let diffSubmodule = false
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 remoteName = 'origin'
const outputRenamedFilesAsDeletedAndAdded =
inputs.outputRenamedFilesAsDeletedAndAdded
let submodulePaths: string[] = []
if (hasSubmodule) {
if (diffSubmodule) {
submodulePaths = await getSubmodulePath({cwd: workingDirectory})
}
@@ -83,29 +95,30 @@ const getChangedFilesFromLocalGitHistory = async ({
if (!github.context.payload.pull_request?.base?.ref) {
core.info(`Running on a ${github.context.eventName || 'push'} event...`)
diffResult = await getSHAForNonPullRequestEvent(
diffResult = await getSHAForNonPullRequestEvent({
inputs,
env,
workingDirectory,
isShallow,
hasSubmodule,
diffSubmodule,
gitFetchExtraArgs,
isTag
)
isTag,
remoteName
})
} else {
core.info(
`Running on a ${github.context.eventName || 'pull_request'} (${
github.context.payload.action
}) event...`
)
diffResult = await getSHAForPullRequestEvent(
diffResult = await getSHAForPullRequestEvent({
inputs,
env,
workingDirectory,
isShallow,
hasSubmodule,
gitFetchExtraArgs
)
diffSubmodule,
gitFetchExtraArgs,
remoteName
})
}
if (diffResult.initialCommit) {
@@ -120,7 +133,7 @@ const getChangedFilesFromLocalGitHistory = async ({
const allDiffFiles = await getAllDiffFiles({
workingDirectory,
hasSubmodule,
diffSubmodule,
diffResult,
submodulePaths,
outputRenamedFilesAsDeletedAndAdded,
@@ -146,7 +159,7 @@ const getChangedFilesFromLocalGitHistory = async ({
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
recoverPatterns,
diffResult,
hasSubmodule,
diffSubmodule,
submodulePaths
})
}
@@ -164,7 +177,7 @@ const getChangedFilesFromLocalGitHistory = async ({
const allOldNewRenamedFiles = await getRenamedFiles({
inputs,
workingDirectory,
hasSubmodule,
diffSubmodule,
diffResult,
submodulePaths
})

View File

@@ -32,11 +32,13 @@ export const normalizeSeparators = (p: string): string => {
// Remove redundant slashes
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.replace(/\/\/+/g, '/')
return p
}
/**
@@ -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'
}
export const getRemoteBranchHeadSha = async ({
cwd,
branch
branch,
remoteName
}: {
cwd: string
branch: string
remoteName: string
}): Promise<string> => {
const {stdout} = await exec.getExecOutput(
'git',
['rev-parse', `origin/${branch}`],
['rev-parse', `${remoteName}/${branch}`],
{
cwd,
silent: !core.isDebug()
@@ -1417,7 +1415,7 @@ export const recoverDeletedFiles = async ({
deletedFiles,
recoverPatterns,
diffResult,
hasSubmodule,
diffSubmodule,
submodulePaths
}: {
inputs: Inputs
@@ -1425,7 +1423,7 @@ export const recoverDeletedFiles = async ({
deletedFiles: string[]
recoverPatterns: string[]
diffResult: DiffResult
hasSubmodule: boolean
diffSubmodule: boolean
submodulePaths: string[]
}): Promise<void> => {
let recoverableDeletedFiles = deletedFiles
@@ -1455,7 +1453,7 @@ export const recoverDeletedFiles = async ({
const submodulePath = submodulePaths.find(p => deletedFile.startsWith(p))
if (hasSubmodule && submodulePath) {
if (diffSubmodule && submodulePath) {
const submoduleShaResult = await gitSubmoduleDiffSHA({
cwd: workingDirectory,
parentSha1: diffResult.previousSha,

1147
yarn.lock

File diff suppressed because it is too large Load Diff