Compare commits

...

104 Commits

Author SHA1 Message Date
repo-ranger[bot]
3996bc3fde Merge pull request #810 from tj-actions/fix/pulling-current-branch-history
fix: pulling current branch history
2022-11-17 20:15:36 +00:00
Tonye Jack
7b68fcd082 Update diff-sha.sh 2022-11-17 12:59:15 -07:00
repo-ranger[bot]
c8dc4b69b8 Merge branch 'main' into fix/pulling-current-branch-history 2022-11-17 19:34:46 +00:00
Tonye Jack
0265ed819d Update README.md 2022-11-17 12:33:38 -07:00
Tonye Jack
96ce8da4f6 Update diff-sha.sh 2022-11-17 12:32:34 -07:00
Tonye Jack
2ed48aa52f Update diff-sha.sh 2022-11-17 12:25:27 -07:00
Tonye Jack
434c3eaa98 Merge branch 'main' into fix/pulling-current-branch-history 2022-11-17 12:19:28 -07:00
Tonye Jack
0efacabbb5 Update diff-sha.sh 2022-11-17 12:05:17 -07:00
Tonye Jack
61fac4da4b Updated diff-sha.sh 2022-11-17 08:28:46 -07:00
Tonye Jack
6ea66cc129 Updated diff-sha.sh 2022-11-17 08:24:46 -07:00
Tonye Jack
30b9252953 Updated diff-sha.sh 2022-11-17 08:16:17 -07:00
Tonye Jack
3b10cebd3d Update diff-sha.sh 2022-11-16 21:06:22 -07:00
repo-ranger[bot]
171e4353ac Merge pull request #811 from tj-actions/chore/update-readme
Updated README.md
2022-11-16 19:15:40 +00:00
jackton1
1882e2f481 Updated README.md 2022-11-16 18:53:06 +00:00
Tonye Jack
0c4c0c47b8 Update README.md 2022-11-16 11:52:30 -07:00
Tonye Jack
fe3a37012f Update action.yml 2022-11-16 11:46:53 -07:00
Tonye Jack
fe47f7dc4c fix: pulling current branch history 2022-11-16 11:29:35 -07:00
repo-ranger[bot]
61e93c8aeb Merge pull request #808 from tj-actions/upgrade-to-v34.4.2
Upgraded to v34.4.2
2022-11-15 21:19:52 +00:00
jackton1
73e225f69c Upgraded from v34.4.1 -> v34.4.2 2022-11-15 20:30:41 +00:00
repo-ranger[bot]
ef0a29048c Merge pull request #806 from tj-actions/fix/bug-with-retrieving-the-last-remote-commit
fix: bug with retrieving the last remote commit
2022-11-15 18:42:00 +00:00
Tonye Jack
e447432ead Update diff-sha.sh 2022-11-15 11:11:36 -07:00
Tonye Jack
4203489288 Update diff-sha.sh 2022-11-15 11:08:51 -07:00
Tonye Jack
e7e332ee69 Update sync-release-version.yml 2022-11-15 10:50:44 -07:00
Tonye Jack
1bf2487713 Update test.yml 2022-11-15 10:45:13 -07:00
Tonye Jack
07952792bb Update test.yml 2022-11-15 10:43:14 -07:00
Tonye Jack
3e827ae4d1 Update diff-sha.sh 2022-11-15 10:38:56 -07:00
Tonye Jack
839d5701db fix: bug with retrieving the last remote commit 2022-11-15 10:29:27 -07:00
repo-ranger[bot]
3ebdc42d8b Merge pull request #804 from tj-actions/fix/bug-finding-merge-base
fix: finding merge-base
2022-11-15 17:16:30 +00:00
repo-ranger[bot]
747f9e656c Merge branch 'main' into fix/bug-finding-merge-base 2022-11-15 16:44:39 +00:00
Tonye Jack
9d429cc7ac Merge pull request #805 from tj-actions/chore/update-sync-release-version-yml
chore: update sync-release-version.yml
2022-11-15 09:43:25 -07:00
Tonye Jack
b04424611d chore: update sync-release-version.yml 2022-11-15 09:41:55 -07:00
Tonye Jack
4f5723a9fe fix: finding merge-base 2022-11-15 09:31:41 -07:00
Tonye Jack
d362fea453 Merge pull request #800 from tj-actions/upgrade-to-v34.4.0 2022-11-11 09:58:40 -07:00
jackton1
22ede94fe5 Upgraded from v34.3.4 -> v34.4.0 2022-11-11 16:47:16 +00:00
repo-ranger[bot]
94e6fba8d8 Merge pull request #799 from tj-actions/chore/update-test
chore: update test
2022-11-11 16:02:44 +00:00
Tonye Jack
61fb39f691 Update test.yml 2022-11-11 08:46:24 -07:00
Tonye Jack
9478e36442 chore: update test 2022-11-11 08:21:05 -07:00
repo-ranger[bot]
e6bd87aabe Merge pull request #798 from tj-actions/feat/update-retrieving-merge-base
feat: skip merge-base check for non shallow clones and fallback to using --fork-point
2022-11-11 15:13:59 +00:00
Tonye Jack
443b6c32e7 Show progress 2022-11-11 07:47:09 -07:00
Tonye Jack
56a01f8a9e Update arguments 2022-11-11 07:44:25 -07:00
Tonye Jack
2e4e636392 Updated the retrieving the merge-base 2022-11-11 07:39:00 -07:00
Tonye Jack
c21087a6bb updated test 2022-11-11 07:33:01 -07:00
Tonye Jack
ac07453ae9 feat: skip merge-base check for non shallow clones and fallback to using --fork-point 2022-11-11 07:28:34 -07:00
Tonye Jack
43835a2749 Merge pull request #796 from tj-actions/chore/update-bug-issue-template
chore: update bug issue template
2022-11-09 18:43:37 -07:00
Tonye Jack
36f5714273 chore: update bug issue template 2022-11-09 13:37:12 -07:00
Tonye Jack
d48d7b71f5 Merge pull request #793 from tj-actions/chore/update-readme
chore: update readme
2022-11-08 14:19:45 -07:00
Tonye Jack
b82208d0c1 Merge pull request #794 from tj-actions/upgrade-to-v34.3.4
Upgraded to v34.3.4
2022-11-08 14:19:30 -07:00
jackton1
9f7a99a9af Upgraded from v34.3.3 -> v34.3.4 2022-11-08 20:47:19 +00:00
Tonye Jack
a37f1b1575 chore: update readme 2022-11-08 13:24:38 -07:00
Tonye Jack
3dbb79f467 Merge pull request #792 from tj-actions/chore/update-readme
Updated README.md
2022-11-08 13:13:51 -07:00
jackton1
44220f8c89 Updated README.md 2022-11-08 20:12:42 +00:00
Tonye Jack
e43adb629b Merge pull request #791 from tj-actions/fix/re-add-ability-to-change-the-max-fetch-depth 2022-11-08 13:11:28 -07:00
Tonye Jack
3c0e266bd5 Update README.md 2022-11-08 12:46:13 -07:00
Tonye Jack
67230d6de5 fix: re-add ability to change the max fetch depth 2022-11-08 12:45:25 -07:00
Tonye Jack
6a9cc33099 Merge pull request #788 from tj-actions/upgrade-to-v34.3.3 2022-11-08 11:50:57 -07:00
jackton1
4b4f463907 Upgraded from v34.3.1 -> v34.3.3 2022-11-08 18:30:37 +00:00
Tonye Jack
991e8b3aae Merge pull request #787 from tj-actions/fix/bug-with-force-pushing-commits-to-pr-branches 2022-11-08 11:26:37 -07:00
Tonye Jack
420a7792d0 fix: bug with force pushing commits to pr branches 2022-11-08 11:06:59 -07:00
renovate[bot]
e062ae86aa chore(deps): update tj-actions/glob action to v16 2022-11-08 10:41:17 -07:00
Tonye Jack
6326c61a70 Merge pull request #786 from tj-actions/fix/bug-with-invalid-branch-name 2022-11-08 09:43:38 -07:00
Tonye Jack
eea929be22 fixed the test 2022-11-08 09:31:21 -07:00
Tonye Jack
9962dc418e fix: bug with invalid branch name 2022-11-08 09:00:45 -07:00
Tonye Jack
77f03d2bb5 Merge pull request #784 from tj-actions/chore/update-readme 2022-11-07 15:19:23 -07:00
Tonye Jack
a236f54cc9 chore: update readme 2022-11-07 15:07:54 -07:00
Tonye Jack
de6d1ed419 Merge pull request #781 from tj-actions/upgrade-to-v34.3.2
Upgraded to v34.3.2
2022-11-07 12:02:43 -07:00
jackton1
5345fb6b0e Upgraded from v34.3.0 -> v34.3.2 2022-11-07 17:11:10 +00:00
Tonye Jack
72d3bb8b33 Merge pull request #779 from tj-actions/chore/update-readme
chore: update readme
2022-11-07 08:23:09 -07:00
Tonye Jack
d908ddd2ef Merge pull request #780 from tj-actions/fix/similar-commit-hashes 2022-11-07 08:21:33 -07:00
Tonye Jack
8dc46ae460 fix: similar commit hashes 2022-11-07 08:04:54 -07:00
Tonye Jack
1218e11f1e chore: update readme 2022-11-07 07:11:40 -07:00
Tonye Jack
18ddeeb8bc Merge pull request #777 from tj-actions/upgrade-to-v34.3.0 2022-11-07 07:09:37 -07:00
jackton1
3b614c0cfa Upgraded from v34.2.2 -> v34.3.0 2022-11-07 07:56:36 +00:00
Tonye Jack
5f89dc7d6e Merge pull request #776 from tj-actions/chore/exclude-fetching-tag
chore: exclude fetching tags
2022-11-06 23:51:55 -07:00
Tonye Jack
2d251d6924 Update diff-sha.sh 2022-11-06 23:49:17 -07:00
Tonye Jack
c46761fdcd Update diff-sha.sh 2022-11-06 23:28:15 -07:00
Tonye Jack
321490c60a Update diff-sha.sh 2022-11-06 22:53:53 -07:00
Tonye Jack
dc88c3a0c5 chore: exclude fetching tags 2022-11-06 22:31:54 -07:00
Tonye Jack
2125c059c3 Merge pull request #775 from tj-actions/chore/update-test
chore: update test
2022-11-06 21:58:23 -07:00
Tonye Jack
f6e319ef2e Merge branch 'main' into chore/update-test 2022-11-06 21:50:44 -07:00
Tonye Jack
3d1f14f079 Merge pull request #774 from tj-actions/chore/update-readme 2022-11-06 21:19:53 -07:00
Tonye Jack
1abc7bec79 chore: update test 2022-11-06 21:18:59 -07:00
jackton1
18dfe0dd4e Updated README.md 2022-11-07 04:00:58 +00:00
Tonye Jack
c94657a1d8 Merge pull request #773 from tj-actions/feat/add-support-for-using-the-last-remote-commit
feat: add support for using the last remote commit
2022-11-06 21:00:26 -07:00
Tonye Jack
c755692dde Update test.yml 2022-11-06 20:50:36 -07:00
Tonye Jack
1e46f60599 feat: add support for using the last remote commit 2022-11-06 19:50:53 -07:00
Tonye Jack
f009ea4a47 Merge pull request #772 from tj-actions/upgrade-to-v34.2.2
Upgraded to v34.2.2
2022-11-06 11:21:25 -07:00
jackton1
7cdc68de58 Upgraded from v34.2.1 -> v34.2.2 2022-11-06 17:52:52 +00:00
Tonye Jack
734bb168e3 Merge pull request #771 from tj-actions/chore/update-readme
Updated README.md
2022-11-06 10:46:31 -07:00
Tonye Jack
6e227a5e76 Merge branch 'main' into chore/update-readme 2022-11-06 10:38:29 -07:00
jackton1
307c11527a Updated README.md 2022-11-06 16:08:19 +00:00
Tonye Jack
5621d09ed1 Merge pull request #770 from tj-actions/chore/update-readme
Updated README.md
2022-11-06 08:59:37 -07:00
jackton1
8c4057e25f Updated README.md 2022-11-06 15:57:02 +00:00
Tonye Jack
8f47019836 Merge pull request #769 from tj-actions/chore/update-readme
Updated README.md
2022-11-06 08:56:39 -07:00
jackton1
7a799a583e Updated README.md 2022-11-06 15:54:10 +00:00
Tonye Jack
ae54c380bb Merge pull request #768 from tj-actions/all-contributors/add-kenji-miyake
docs: add kenji-miyake as a contributor for code
2022-11-06 08:52:43 -07:00
Tonye Jack
738ce05a6a Merge branch 'main' into all-contributors/add-kenji-miyake 2022-11-06 08:52:05 -07:00
Tonye Jack
b4f323482c Merge pull request #767 from kenji-miyake/fix-sha-required
chore: change `sha` to non-required
2022-11-06 08:51:51 -07:00
allcontributors[bot]
e957501bc3 docs: update .all-contributorsrc [skip ci] 2022-11-06 15:51:45 +00:00
allcontributors[bot]
f38b70aee3 docs: update README.md [skip ci] 2022-11-06 15:51:44 +00:00
Kenji Miyake
62aa9ed8ce chore: change sha to non-required
Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
2022-11-06 13:16:38 +09:00
Tonye Jack
eada3203b5 Update README.md 2022-11-05 13:19:37 -06:00
Tonye Jack
e2d72e213a Update README.md 2022-11-05 04:58:48 -06:00
Tonye Jack
664f1245dd Merge pull request #765 from tj-actions/upgrade-to-v34.2.1
Upgraded to v34.2.1
2022-11-05 04:39:09 -06:00
jackton1
d41a74b958 Upgraded from v34.2.0 -> v34.2.1 2022-11-05 10:01:13 +00:00
7 changed files with 311 additions and 87 deletions

View File

@@ -150,6 +150,15 @@
"contributions": [
"code"
]
},
{
"login": "kenji-miyake",
"name": "Kenji Miyake",
"avatar_url": "https://avatars.githubusercontent.com/u/31987104?v=4",
"profile": "https://www.linkedin.com/in/kenji-miyake/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,

View File

@@ -69,13 +69,14 @@ body:
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
description: Please copy and paste any relevant log output which is obtained after enabling debug logging. This will be automatically formatted into code, so no need for backticks.
placeholder: |
This can be achieved by:
1. Re-running the workflow with debug logging enabled.
2. Copy or download the log archive.
3. Paste the contents here or upload the file in a subsequent comment.
render: shell
validations:
required: true
- type: textarea
attributes:
label: Anything else?

View File

@@ -27,13 +27,15 @@ jobs:
uses: actions/checkout@v3
- name: shellcheck
uses: reviewdog/action-shellcheck@v1.15
with:
github_token: ${{ secrets.PAT_TOKEN }}
test-multiple-repositories:
name: Test with multiple repositories
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
max-parallel: 4
max-parallel: 2
matrix:
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
steps:
@@ -90,7 +92,7 @@ jobs:
if: github.event_name == 'push'
strategy:
fail-fast: false
max-parallel: 4
max-parallel: 2
matrix:
platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022]
@@ -127,9 +129,9 @@ jobs:
until: "2022-08-20"
- name: Check output
if: "!contains(steps.changed-files-until.outputs.all_changed_files, 'entrypoint.sh')"
if: "!contains(steps.changed-files-until.outputs.all_changed_files, 'README.md')"
run: |
echo "Invalid output: Expected to include (entrypoint.sh) got (${{ steps.changed-files-until.outputs.all_changed_files }})"
echo "Invalid output: Expected to include (README.md) got (${{ steps.changed-files-until.outputs.all_changed_files }})"
exit 1
shell:
bash
@@ -299,7 +301,7 @@ jobs:
uses: ./
continue-on-error: true
with:
base_sha: "4554456"
sha: "4774456"
- name: Show output
run: |
@@ -319,7 +321,7 @@ jobs:
continue-on-error: true
with:
files: action.yml
base_sha: "4554456"
sha: "4774456"
- name: Show output
run: |
@@ -361,6 +363,16 @@ jobs:
echo '${{ toJSON(steps.changed-files.outputs) }}'
shell:
bash
- name: Run changed-files with since_last_remote_commit
id: changed-files-since-last-remote-commit
uses: ./
with:
since_last_remote_commit: true
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
shell:
bash
- name: Run changed-files with include_all_old_new_renamed_files
id: changed-files-all-old-new-renamed-files
uses: ./
@@ -899,7 +911,7 @@ jobs:
bash
- name: Run changed-files with custom sha
id: changed-files-custom-sha
if: github.event.action != 'closed'
if: github.event_name == 'pull_request' && github.event.action != 'closed'
uses: ./
with:
sha: ${{ github.event.pull_request.head.sha }}
@@ -919,7 +931,7 @@ jobs:
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.PAT_TOKEN }}
- name: Run changed-files with a custom base sha
if: github.event_name == 'pull_request' && github.event.action != 'closed'
id: changed-files-custom-base-sha

View File

@@ -1,12 +1,151 @@
# Changelog
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.4.2...HEAD)
**Fixed bugs:**
- \[BUG\] diff-sha.sh results in "fatal: ambiguous argument '': unknown revision or path not in the working tree." [\#750](https://github.com/tj-actions/changed-files/issues/750)
## [v34.4.2](https://github.com/tj-actions/changed-files/tree/v34.4.2) (2022-11-15)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.4.2)
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-15)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.4.1...v34)
**Fixed bugs:**
- \[BUG\] Infinite loop on v34.4.0 [\#803](https://github.com/tj-actions/changed-files/issues/803)
- Unable to locate a common ancestor between production\_migration and HEAD [\#802](https://github.com/tj-actions/changed-files/issues/802)
**Merged pull requests:**
- fix: bug with retrieving the last remote commit [\#806](https://github.com/tj-actions/changed-files/pull/806) ([jackton1](https://github.com/jackton1))
## [v34.4.1](https://github.com/tj-actions/changed-files/tree/v34.4.1) (2022-11-15)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.4.0...v34.4.1)
**Fixed bugs:**
- \[BUG\] Very simple branch gives: "Unable to find merge-base between main and HEAD." [\#797](https://github.com/tj-actions/changed-files/issues/797)
**Merged pull requests:**
- chore: update sync-release-version.yml [\#805](https://github.com/tj-actions/changed-files/pull/805) ([jackton1](https://github.com/jackton1))
- fix: finding merge-base [\#804](https://github.com/tj-actions/changed-files/pull/804) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.4.0 [\#800](https://github.com/tj-actions/changed-files/pull/800) ([jackton1](https://github.com/jackton1))
## [v34.4.0](https://github.com/tj-actions/changed-files/tree/v34.4.0) (2022-11-11)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.4...v34.4.0)
**Fixed bugs:**
- \[BUG\] Specfic File Bug in v33 / v34 - grep: : No such file or directory [\#795](https://github.com/tj-actions/changed-files/issues/795)
- \[BUG\] Please verify that the previous sha is valid, and increase the fetch\_depth to a number higher than 40. [\#790](https://github.com/tj-actions/changed-files/issues/790)
**Merged pull requests:**
- chore: update test [\#799](https://github.com/tj-actions/changed-files/pull/799) ([jackton1](https://github.com/jackton1))
- feat: skip merge-base check for non shallow clones and fallback to using --fork-point [\#798](https://github.com/tj-actions/changed-files/pull/798) ([jackton1](https://github.com/jackton1))
- chore: update bug issue template [\#796](https://github.com/tj-actions/changed-files/pull/796) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.3.4 [\#794](https://github.com/tj-actions/changed-files/pull/794) ([jackton1](https://github.com/jackton1))
- chore: update readme [\#793](https://github.com/tj-actions/changed-files/pull/793) ([jackton1](https://github.com/jackton1))
## [v34.3.4](https://github.com/tj-actions/changed-files/tree/v34.3.4) (2022-11-08)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.3...v34.3.4)
**Merged pull requests:**
- Updated README.md [\#792](https://github.com/tj-actions/changed-files/pull/792) ([jackton1](https://github.com/jackton1))
- fix: re-add ability to change the max fetch depth [\#791](https://github.com/tj-actions/changed-files/pull/791) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.3.3 [\#788](https://github.com/tj-actions/changed-files/pull/788) ([jackton1](https://github.com/jackton1))
## [v34.3.3](https://github.com/tj-actions/changed-files/tree/v34.3.3) (2022-11-08)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.1...v34.3.3)
**Fixed bugs:**
- \[BUG\] Action compares only two latest commits on push [\#783](https://github.com/tj-actions/changed-files/issues/783)
- Detected dubious ownership in repository error when running the action [\#782](https://github.com/tj-actions/changed-files/issues/782)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:**
- fix: bug with force pushing commits to pr branches [\#787](https://github.com/tj-actions/changed-files/pull/787) ([jackton1](https://github.com/jackton1))
- fix: bug with invalid branch name [\#786](https://github.com/tj-actions/changed-files/pull/786) ([jackton1](https://github.com/jackton1))
- chore\(deps\): update tj-actions/glob action to v16 [\#785](https://github.com/tj-actions/changed-files/pull/785) ([renovate[bot]](https://github.com/apps/renovate))
- chore: update readme [\#784](https://github.com/tj-actions/changed-files/pull/784) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.3.2 [\#781](https://github.com/tj-actions/changed-files/pull/781) ([jackton1](https://github.com/jackton1))
## [v34.3.1](https://github.com/tj-actions/changed-files/tree/v34.3.1) (2022-11-07)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.2...v34.3.1)
## [v34.3.2](https://github.com/tj-actions/changed-files/tree/v34.3.2) (2022-11-07)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.3.0...v34.3.2)
**Fixed bugs:**
- \[BUG\] Similar commit hashes detected: previous sha: abc123 is equivalent to the current sha: abc123 on PR merge [\#778](https://github.com/tj-actions/changed-files/issues/778)
**Merged pull requests:**
- fix: similar commit hashes [\#780](https://github.com/tj-actions/changed-files/pull/780) ([jackton1](https://github.com/jackton1))
- chore: update readme [\#779](https://github.com/tj-actions/changed-files/pull/779) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.3.0 [\#777](https://github.com/tj-actions/changed-files/pull/777) ([jackton1](https://github.com/jackton1))
## [v34.3.0](https://github.com/tj-actions/changed-files/tree/v34.3.0) (2022-11-07)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.2...v34.3.0)
**Closed issues:**
- How can I let the workflow to detect the changes only in the certain micro service? [\#766](https://github.com/tj-actions/changed-files/issues/766)
**Merged pull requests:**
- chore: exclude fetching tags [\#776](https://github.com/tj-actions/changed-files/pull/776) ([jackton1](https://github.com/jackton1))
- chore: update test [\#775](https://github.com/tj-actions/changed-files/pull/775) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#774](https://github.com/tj-actions/changed-files/pull/774) ([jackton1](https://github.com/jackton1))
- feat: add support for using the last remote commit [\#773](https://github.com/tj-actions/changed-files/pull/773) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.2.2 [\#772](https://github.com/tj-actions/changed-files/pull/772) ([jackton1](https://github.com/jackton1))
## [v34.2.2](https://github.com/tj-actions/changed-files/tree/v34.2.2) (2022-11-06)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.1...v34.2.2)
**Merged pull requests:**
- Updated README.md [\#771](https://github.com/tj-actions/changed-files/pull/771) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#770](https://github.com/tj-actions/changed-files/pull/770) ([jackton1](https://github.com/jackton1))
- Updated README.md [\#769](https://github.com/tj-actions/changed-files/pull/769) ([jackton1](https://github.com/jackton1))
- docs: add kenji-miyake as a contributor for code [\#768](https://github.com/tj-actions/changed-files/pull/768) ([allcontributors[bot]](https://github.com/apps/allcontributors))
- chore: change `sha` to non-required [\#767](https://github.com/tj-actions/changed-files/pull/767) ([kenji-miyake](https://github.com/kenji-miyake))
- Upgraded to v34.2.1 [\#765](https://github.com/tj-actions/changed-files/pull/765) ([jackton1](https://github.com/jackton1))
## [v34.2.1](https://github.com/tj-actions/changed-files/tree/v34.2.1) (2022-11-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.0...v34.2.1)
**Merged pull requests:**
- chore: update debug message [\#764](https://github.com/tj-actions/changed-files/pull/764) ([jackton1](https://github.com/jackton1))
- Upgraded to v34.2.0 [\#763](https://github.com/tj-actions/changed-files/pull/763) ([jackton1](https://github.com/jackton1))
## [v34.2.0](https://github.com/tj-actions/changed-files/tree/v34.2.0) (2022-11-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.2.0)
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-05)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.1.1...v34)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.1.1...v34.2.0)
**Fixed bugs:**
@@ -45,7 +184,6 @@
**Fixed bugs:**
- \[BUG\] diff-sha.sh results in "fatal: ambiguous argument '': unknown revision or path not in the working tree." [\#750](https://github.com/tj-actions/changed-files/issues/750)
- \[BUG\] Action failing on PR with "Unable to find merge-base in shallow clone" [\#737](https://github.com/tj-actions/changed-files/issues/737)
- \[BUG\] Wrong changed-files returned for forked PRs [\#714](https://github.com/tj-actions/changed-files/issues/714)
@@ -115,10 +253,6 @@
- \[BUG\] Auto-Merge not working properly on Change-Detection for PRs [\#713](https://github.com/tj-actions/changed-files/issues/713)
**Closed issues:**
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
**Merged pull requests:**
- Updated README.md [\#725](https://github.com/tj-actions/changed-files/pull/725) ([jackton1](https://github.com/jackton1))
@@ -136,7 +270,7 @@
## [v34.0.0](https://github.com/tj-actions/changed-files/tree/v34.0.0) (2022-10-25)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33.0.0...v34.0.0)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33...v34.0.0)
**Fixed bugs:**
@@ -149,13 +283,13 @@
- feat: add support for fetching more history [\#709](https://github.com/tj-actions/changed-files/pull/709) ([jackton1](https://github.com/jackton1))
- Upgraded to v33.0.0 [\#707](https://github.com/tj-actions/changed-files/pull/707) ([jackton1](https://github.com/jackton1))
## [v33.0.0](https://github.com/tj-actions/changed-files/tree/v33.0.0) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33...v33.0.0)
## [v33](https://github.com/tj-actions/changed-files/tree/v33) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v32...v33)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v33.0.0...v33)
## [v33.0.0](https://github.com/tj-actions/changed-files/tree/v33.0.0) (2022-10-21)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v32...v33.0.0)
**Closed issues:**
@@ -1193,7 +1327,7 @@
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-02-17)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v13)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v13)
**Implemented enhancements:**
@@ -1212,13 +1346,13 @@
- \[BUG\] wrong result of any\_change output [\#314](https://github.com/tj-actions/changed-files/issues/314)
- \[BUG\] Investigate possible bug using since\_last\_remote\_commit when force pushing changes. [\#303](https://github.com/tj-actions/changed-files/issues/303)
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.2...v2.0.1)
## [v12.2](https://github.com/tj-actions/changed-files/tree/v12.2) (2021-12-30)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v12.2)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v12.2)
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v12.1...v2.0.1)
**Merged pull requests:**

View File

@@ -9,7 +9,7 @@
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
@@ -52,9 +52,13 @@ Retrieve all changed files and directories relative to the target branch or the
name: CI
on:
# Compare the preceeding commit of main -> to the current commit of the main branch.
# (Note: To compare changes between the last pushed commit to the remote main branch set `since_last_remote_commit: true`)
push:
branches:
- main
# Compare the last commit of main -> to the current commit of a PR branch.
# (Note: To compare changes between the last pushed commit to the remote PR branch set `since_last_remote_commit: true`)
pull_request:
branches:
- main
@@ -94,6 +98,8 @@ jobs:
echo "List all the files that have changed: ${{ steps.changed-files-specific.outputs.all_changed_files }}"
```
I want to thank everyone supporting and using this project, your are awesome. Special thanks to every contributor.
If you feel generous and want to show some extra appreciation:
Support this project with a :star:
@@ -151,28 +157,30 @@ Support this project with a :star:
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-----------------------------------|--------|----------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| base\_sha | string | false | | Specify a different base commit<br>SHA used for comparing changes<br> |
| diff\_relative | string | false | | Exclude changes outside the current<br>directory and show pathnames relative<br>to it. **NOTE:** This requires<br>you to specify the top<br>level directory via the `path`<br>input. |
| dir\_names | string | false | `"false"` | Output unique changed directories instead<br>of filenames. **NOTE:** This returns<br>`.` for changed files located<br>in the root of the<br>project. |
| fetch\_depth | string | false | `"40"` | Limit depth of the branch<br>history fetched. **NOTE**: This can<br>be adjusted to resolve errors<br>with insufficient history. |
| files | string | false | | File and directory patterns to<br>detect changes using only these<br>list of file(s) (Defaults to<br>the entire repo) **NOTE:** Multiline<br>file/directory patterns should not include<br>qoutes. |
| files\_from\_source\_file | string | false | | Source file(s) used to populate<br>the `files` input. |
| files\_ignore | string | false | | Ignore changes to these file(s)<br>**NOTE:** Multiline file/directory patterns should<br>not include qoutes. |
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate<br>the `files_ignore` input |
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the<br>`files-ignore` input |
| files\_separator | string | false | `"\n"` | Separator used to split the<br>`files` input |
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this<br>can generate a large output<br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
| json | string | false | `"false"` | Output list of changed files<br>in a JSON formatted string<br>which can be used for<br>matrix jobs. |
| old\_new\_files\_separator | string | false | `" "` | Split character for multiple old<br>and new filename pairs. |
| old\_new\_separator | string | false | `","` | Split character for old and<br>new filename pairs. |
| path | string | false | `"."` | Specify a relative path under<br>`$GITHUB_WORKSPACE` to locate the repository.<br> |
| quotepath | string | false | `"true"` | Use non ascii characters to<br>match files and output the<br>filenames completely verbatim by setting<br>this to `false` |
| separator | string | false | `" "` | Split character for output strings<br> |
| sha | string | true | `"${{ github.sha }}"` | Specify a different commit SHA<br>used for comparing changes |
| since | string | false | | Get changed files for commits<br>whose timestamp is older than<br>the given time. |
| until | string | false | | Get changed files for commits<br>whose timestamp is earlier than<br>the given time. |
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-----------------------------------|--------|----------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| base\_sha | string | false | | Specify a different base commit<br>SHA used for comparing changes<br> |
| diff\_relative | string | false | | Exclude changes outside the current<br>directory and show pathnames relative<br>to it. **NOTE:** This requires<br>you to specify the top<br>level directory via the `path`<br>input. |
| dir\_names | string | false | `"false"` | Output unique changed directories instead<br>of filenames. **NOTE:** This returns<br>`.` for changed files located<br>in the root of the<br>project. |
| fetch\_depth | string | false | `"40"` | Limit depth of the branch<br>history fetched. **NOTE**: This can<br>be adjusted to resolve errors<br>with insufficient history. |
| files | string | false | | File and directory patterns to<br>detect changes using only these<br>list of file(s) (Defaults to<br>the entire repo) **NOTE:** Multiline<br>file/directory patterns should not include<br>qoutes. |
| files\_from\_source\_file | string | false | | Source file(s) used to populate<br>the `files` input. |
| files\_ignore | string | false | | Ignore changes to these file(s)<br>**NOTE:** Multiline file/directory patterns should<br>not include qoutes. |
| files\_ignore\_from\_source\_file | string | false | | Source file(s) used to populate<br>the `files_ignore` input |
| files\_ignore\_separator | string | false | `"\n"` | Separator used to split the<br>`files-ignore` input |
| files\_separator | string | false | `"\n"` | Separator used to split the<br>`files` input |
| include\_all\_old\_new\_renamed\_files | string | false | `"false"` | Include `all_old_new_renamed_files` output. Note this<br>can generate a large output<br>See: [#501](https://github.com/tj-actions/changed-files/issues/501). |
| json | string | false | `"false"` | Output list of changed files<br>in a JSON formatted string<br>which can be used for<br>matrix jobs. |
| max\_fetch\_depth | string | false | `"5000"` | Maximum depth of the branch<br>history fetched. **NOTE**: This can<br>be adjusted to resolve errors<br>with insufficient history. |
| old\_new\_files\_separator | string | false | `" "` | Split character for multiple old<br>and new filename pairs. |
| old\_new\_separator | string | false | `","` | Split character for old and<br>new filename pairs. |
| path | string | false | `"."` | Specify a relative path under<br>`$GITHUB_WORKSPACE` to locate the repository.<br> |
| quotepath | string | false | `"true"` | Use non ascii characters to<br>match files and output the<br>filenames completely verbatim by setting<br>this to `false` |
| separator | string | false | `" "` | Split character for output strings<br> |
| sha | string | false | `"${{ github.sha }}"` | Specify a different commit SHA<br>used for comparing changes |
| since | string | false | | Get changed files for commits<br>whose timestamp is older than<br>the given time. |
| since\_last\_remote\_commit | string | true | `"false"` | Use the last commit on<br>the remote branch as the<br>`base_sha`. Defaults to the last<br>non merge commit on the<br>target branch for pull request<br>events and the previous commit<br>of the current branch for<br>push events. |
| until | string | false | | Get changed files for commits<br>whose timestamp is earlier than<br>the given time. |
<!-- AUTO-DOC-INPUT:END -->
@@ -328,8 +336,7 @@ See [outputs](#outputs) for a list of all available outputs.
id: changed-files-specific-source-file
uses: tj-actions/changed-files@v34
with:
files_from_source_file: |
test/changed-files-list.txt
files_from_source_file: test/changed-files-list.txt
...
```
@@ -592,9 +599,10 @@ This package was created with [Cookiecutter](https://github.com/cookiecutter/coo
* [tj-actions/glob](https://github.com/tj-actions/glob)
* [tj-actions/demo](https://github.com/tj-actions/demo)
* [tj-actions/demo2](https://github.com/tj-actions/demo2)
* [tj-actions/demo3](https://github.com/tj-actions/demo3)
* [tj-actions/release-tagger](https://github.com/tj-actions/release-tagger)
* [tj-actions/auto-doc](https://github.com/tj-actions/auto-doc)
* \[tj-actions/verify-changed-files]\(https://github.com/tj-actions/verify-changed-files
* [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files)
## Report Bugs
@@ -603,7 +611,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.
* Any 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 ✨
@@ -639,6 +647,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center"><a href="https://github.com/kostiantyn-korniienko-aurea"><img src="https://avatars.githubusercontent.com/u/37180625?v=4?s=100" width="100px;" alt="Kostiantyn Korniienko"/><br /><sub><b>Kostiantyn Korniienko</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kostiantyn-korniienko-aurea" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/lpulley"><img src="https://avatars.githubusercontent.com/u/7193187?v=4?s=100" width="100px;" alt="Logan Pulley"/><br /><sub><b>Logan Pulley</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=lpulley" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/kenji-miyake/"><img src="https://avatars.githubusercontent.com/u/31987104?v=4?s=100" width="100px;" alt="Kenji Miyake"/><br /><sub><b>Kenji Miyake</b></sub></a><br /><a href="https://github.com/tj-actions/changed-files/commits?author=kenji-miyake" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -45,7 +45,7 @@ inputs:
default: ""
sha:
description: "Specify a different commit SHA used for comparing changes"
required: true
required: false
default: ${{ github.sha }}
base_sha:
description: "Specify a different base commit SHA used for comparing changes"
@@ -78,9 +78,17 @@ inputs:
required: false
default: "false"
fetch_depth:
description: "Limit depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
description: "Initial depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
required: false
default: "40"
max_fetch_depth:
description: "Maximum depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
required: false
default: "5000"
since_last_remote_commit:
description: "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 commit of the current branch for push events."
required: true
default: "false"
outputs:
added_files:
@@ -173,8 +181,10 @@ runs:
INPUT_UNTIL: ${{ inputs.until }}
INPUT_PATH: ${{ inputs.path }}
INPUT_FETCH_DEPTH: ${{ inputs.fetch_depth }}
INPUT_MAX_FETCH_DEPTH: ${{ inputs.max_fetch_depth }}
INPUT_SINCE_LAST_REMOTE_COMMIT: ${{ inputs.since_last_remote_commit }}
- name: Glob match
uses: tj-actions/glob@v15
uses: tj-actions/glob@v16
id: glob
with:
files: ${{ inputs.files }}

View File

@@ -4,6 +4,13 @@ set -euo pipefail
INITIAL_COMMIT="false"
GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
EXTRA_ARGS="--no-tags"
PREVIOUS_SHA=""
CURRENT_SHA=""
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
EXTRA_ARGS=""
fi
echo "::group::changed-files-diff-sha"
@@ -40,8 +47,6 @@ fi
if [[ -z $GITHUB_BASE_REF ]]; then
echo "Running on a push event..."
TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$?
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
echo "::debug::Getting HEAD SHA..."
if [[ -n "$INPUT_UNTIL" ]]; then
@@ -56,11 +61,15 @@ if [[ -z $GITHUB_BASE_REF ]]; then
if [[ -z $INPUT_SHA ]]; then
CURRENT_SHA=$(git rev-list -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$?
else
git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH"
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH"
CURRENT_SHA=$INPUT_SHA; exit_status=$?
fi
fi
TARGET_BRANCH=$(git name-rev --name-only "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
echo "::debug::Verifying the current commit SHA: $CURRENT_SHA"
git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
@@ -82,12 +91,20 @@ if [[ -z $GITHUB_BASE_REF ]]; then
exit 1
fi
else
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
if [[ -z "$PREVIOUS_SHA" ]]; then
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
PREVIOUS_SHA=""
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
fi
else
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
if [[ -z "$PREVIOUS_SHA" ]]; then
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
fi
fi
fi
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
@@ -110,10 +127,9 @@ if [[ -z $GITHUB_BASE_REF ]]; then
fi
fi
else
git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH"
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH"
PREVIOUS_SHA=$INPUT_BASE_SHA
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
CURRENT_BRANCH=$TARGET_BRANCH
fi
echo "::debug::Target branch $TARGET_BRANCH..."
@@ -131,23 +147,18 @@ else
echo "Running on a pull request event..."
TARGET_BRANCH=$GITHUB_BASE_REF
CURRENT_BRANCH=$GITHUB_HEAD_REF
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
TARGET_BRANCH=$CURRENT_BRANCH
fi
echo "Fetching remote refs..."
git fetch --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH"
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 2>/dev/null || true
depth=$INPUT_FETCH_DEPTH
while [ -z "$( git merge-base "$TARGET_BRANCH" HEAD )" ]; do
git fetch --deepen="$depth" origin "$TARGET_BRANCH" HEAD;
depth=$((depth * 10))
max_depth=5000
if [[ $depth -gt $max_depth ]]; then
echo "::error::Unable to find merge-base between $TARGET_BRANCH and HEAD."
fi
done
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "false" ]]; then
# shellcheck disable=SC2086
git fetch -u --progress $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH"
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 2>/dev/null || true
fi
echo "::debug::Getting HEAD SHA..."
if [[ -n "$INPUT_UNTIL" ]]; then
@@ -178,10 +189,25 @@ else
fi
if [[ -z $INPUT_BASE_SHA ]]; then
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
if [[ -z "$PREVIOUS_SHA" ]]; then
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
if ! git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1; then
# shellcheck disable=SC2046
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
fi
else
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$CURRENT_SHA" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git rev-parse origin/"$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
fi
fi
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
fi
echo "::debug::Previous SHA: $PREVIOUS_SHA"
else
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
@@ -190,6 +216,29 @@ else
echo "::debug::Target branch: $TARGET_BRANCH"
echo "::debug::Current branch: $CURRENT_BRANCH"
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "false" ]]; then
if [[ -f .git/shallow ]]; then
depth=$INPUT_FETCH_DEPTH
max_depth=$INPUT_MAX_FETCH_DEPTH
while ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$CURRENT_SHA" 1>/dev/null; do
echo "Fetching $depth commits..."
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH"
if [[ $depth -gt $max_depth ]]; then
echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_SHA"
exit 1
fi
depth=$((depth + 300))
done
else
echo "::debug::Not a shallow clone, skipping merge-base check."
fi
fi
echo "::debug::Verifying the previous commit SHA: $PREVIOUS_SHA"
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?