Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72d3bb8b33 | ||
|
|
d908ddd2ef | ||
|
|
8dc46ae460 | ||
|
|
1218e11f1e | ||
|
|
18ddeeb8bc | ||
|
|
3b614c0cfa | ||
|
|
5f89dc7d6e | ||
|
|
2d251d6924 | ||
|
|
c46761fdcd | ||
|
|
321490c60a | ||
|
|
dc88c3a0c5 | ||
|
|
2125c059c3 | ||
|
|
f6e319ef2e | ||
|
|
3d1f14f079 | ||
|
|
1abc7bec79 | ||
|
|
18dfe0dd4e | ||
|
|
c94657a1d8 | ||
|
|
c755692dde | ||
|
|
1e46f60599 | ||
|
|
f009ea4a47 | ||
|
|
7cdc68de58 |
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -361,6 +361,16 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
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
|
- name: Run changed-files with include_all_old_new_renamed_files
|
||||||
id: changed-files-all-old-new-renamed-files
|
id: changed-files-all-old-new-renamed-files
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -899,7 +909,7 @@ jobs:
|
|||||||
bash
|
bash
|
||||||
- name: Run changed-files with custom sha
|
- name: Run changed-files with custom sha
|
||||||
id: changed-files-custom-sha
|
id: changed-files-custom-sha
|
||||||
if: github.event.action != 'closed'
|
if: github.event_name == 'pull_request' && github.event.action != 'closed'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.event.pull_request.head.sha }}
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|||||||
87
HISTORY.md
87
HISTORY.md
@@ -1,12 +1,41 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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...v34.3.0)
|
||||||
|
|
||||||
|
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-07)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.2...v34)
|
||||||
|
|
||||||
|
**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)
|
## [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...v34.2.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.0...v34.2.1)
|
||||||
|
|
||||||
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-05)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.2.0...v34)
|
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -321,7 +350,7 @@
|
|||||||
|
|
||||||
## [v30](https://github.com/tj-actions/changed-files/tree/v30) (2022-09-24)
|
## [v30](https://github.com/tj-actions/changed-files/tree/v30) (2022-09-24)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29...v30)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.9...v30)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -337,13 +366,13 @@
|
|||||||
- chore\(deps\): update codacy/codacy-analysis-cli-action action to v4.2.0 [\#634](https://github.com/tj-actions/changed-files/pull/634) ([renovate[bot]](https://github.com/apps/renovate))
|
- chore\(deps\): update codacy/codacy-analysis-cli-action action to v4.2.0 [\#634](https://github.com/tj-actions/changed-files/pull/634) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v29.0.9 [\#633](https://github.com/tj-actions/changed-files/pull/633) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v29.0.9 [\#633](https://github.com/tj-actions/changed-files/pull/633) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v29](https://github.com/tj-actions/changed-files/tree/v29) (2022-09-20)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.9...v29)
|
|
||||||
|
|
||||||
## [v29.0.9](https://github.com/tj-actions/changed-files/tree/v29.0.9) (2022-09-20)
|
## [v29.0.9](https://github.com/tj-actions/changed-files/tree/v29.0.9) (2022-09-20)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.8...v29.0.9)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29...v29.0.9)
|
||||||
|
|
||||||
|
## [v29](https://github.com/tj-actions/changed-files/tree/v29) (2022-09-20)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.8...v29)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1202,7 +1231,7 @@
|
|||||||
|
|
||||||
## [v13](https://github.com/tj-actions/changed-files/tree/v13) (2022-02-17)
|
## [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:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1221,13 +1250,13 @@
|
|||||||
- \[BUG\] wrong result of any\_change output [\#314](https://github.com/tj-actions/changed-files/issues/314)
|
- \[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)
|
- \[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)
|
## [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:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -1268,7 +1297,7 @@
|
|||||||
|
|
||||||
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
## [v12](https://github.com/tj-actions/changed-files/tree/v12) (2021-12-14)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11...v12)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.9...v12)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1286,13 +1315,13 @@
|
|||||||
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
- \[PR 1\]: Renamed all\_modified\_files to all\_changed\_files [\#283](https://github.com/tj-actions/changed-files/pull/283) ([jackton1](https://github.com/jackton1))
|
||||||
- Upgraded to v11.9 [\#280](https://github.com/tj-actions/changed-files/pull/280) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v11.9 [\#280](https://github.com/tj-actions/changed-files/pull/280) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v11](https://github.com/tj-actions/changed-files/tree/v11) (2021-12-04)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.9...v11)
|
|
||||||
|
|
||||||
## [v11.9](https://github.com/tj-actions/changed-files/tree/v11.9) (2021-12-04)
|
## [v11.9](https://github.com/tj-actions/changed-files/tree/v11.9) (2021-12-04)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...v11.9)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11...v11.9)
|
||||||
|
|
||||||
|
## [v11](https://github.com/tj-actions/changed-files/tree/v11) (2021-12-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...v11)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1381,7 +1410,7 @@
|
|||||||
|
|
||||||
## [v1.2.1](https://github.com/tj-actions/changed-files/tree/v1.2.1) (2021-11-08)
|
## [v1.2.1](https://github.com/tj-actions/changed-files/tree/v1.2.1) (2021-11-08)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.1)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v1.2.1)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1395,13 +1424,13 @@
|
|||||||
- Update actions/checkout action to v2.4.0 [\#243](https://github.com/tj-actions/changed-files/pull/243) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update actions/checkout action to v2.4.0 [\#243](https://github.com/tj-actions/changed-files/pull/243) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v11.5 [\#241](https://github.com/tj-actions/changed-files/pull/241) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v11.5 [\#241](https://github.com/tj-actions/changed-files/pull/241) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.2.0...v11.5)
|
|
||||||
|
|
||||||
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
## [v1.2.0](https://github.com/tj-actions/changed-files/tree/v1.2.0) (2021-10-30)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v1.2.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.5...v1.2.0)
|
||||||
|
|
||||||
|
## [v11.5](https://github.com/tj-actions/changed-files/tree/v11.5) (2021-10-30)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11.4...v11.5)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
|||||||
46
README.md
46
README.md
@@ -153,28 +153,29 @@ Support this project with a :star:
|
|||||||
|
|
||||||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section -->
|
||||||
|
|
||||||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|
||||||
|-----------------------------------|--------|----------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-----------------------------------|--------|----------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| base\_sha | string | false | | Specify a different base commit<br>SHA used for comparing changes<br> |
|
| 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. |
|
| 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. |
|
| 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. |
|
| 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 | 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\_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 | 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\_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\_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 |
|
| 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). |
|
| 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. |
|
| 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\_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. |
|
| 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> |
|
| 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` |
|
| 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> |
|
| separator | string | false | `" "` | Split character for output strings<br> |
|
||||||
| sha | string | false | `"${{ github.sha }}"` | Specify a different commit SHA<br>used for comparing changes |
|
| 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 | 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. |
|
| 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 -->
|
<!-- AUTO-DOC-INPUT:END -->
|
||||||
|
|
||||||
@@ -594,6 +595,7 @@ This package was created with [Cookiecutter](https://github.com/cookiecutter/coo
|
|||||||
* [tj-actions/glob](https://github.com/tj-actions/glob)
|
* [tj-actions/glob](https://github.com/tj-actions/glob)
|
||||||
* [tj-actions/demo](https://github.com/tj-actions/demo)
|
* [tj-actions/demo](https://github.com/tj-actions/demo)
|
||||||
* [tj-actions/demo2](https://github.com/tj-actions/demo2)
|
* [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/release-tagger](https://github.com/tj-actions/release-tagger)
|
||||||
* [tj-actions/auto-doc](https://github.com/tj-actions/auto-doc)
|
* [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)
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ inputs:
|
|||||||
description: "Limit depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
|
description: "Limit depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
|
||||||
required: false
|
required: false
|
||||||
default: "40"
|
default: "40"
|
||||||
|
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:
|
outputs:
|
||||||
added_files:
|
added_files:
|
||||||
@@ -173,6 +177,7 @@ runs:
|
|||||||
INPUT_UNTIL: ${{ inputs.until }}
|
INPUT_UNTIL: ${{ inputs.until }}
|
||||||
INPUT_PATH: ${{ inputs.path }}
|
INPUT_PATH: ${{ inputs.path }}
|
||||||
INPUT_FETCH_DEPTH: ${{ inputs.fetch_depth }}
|
INPUT_FETCH_DEPTH: ${{ inputs.fetch_depth }}
|
||||||
|
INPUT_SINCE_LAST_REMOTE_COMMIT: ${{ inputs.since_last_remote_commit }}
|
||||||
- name: Glob match
|
- name: Glob match
|
||||||
uses: tj-actions/glob@v15
|
uses: tj-actions/glob@v15
|
||||||
id: glob
|
id: glob
|
||||||
|
|||||||
76
diff-sha.sh
76
diff-sha.sh
@@ -4,6 +4,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
INITIAL_COMMIT="false"
|
INITIAL_COMMIT="false"
|
||||||
GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
||||||
|
EXTRA_ARGS="--no-tags"
|
||||||
|
|
||||||
|
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
|
||||||
|
EXTRA_ARGS=""
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::group::changed-files-diff-sha"
|
echo "::group::changed-files-diff-sha"
|
||||||
|
|
||||||
@@ -56,7 +61,8 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
if [[ -z $INPUT_SHA ]]; then
|
if [[ -z $INPUT_SHA ]]; then
|
||||||
CURRENT_SHA=$(git rev-list -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$?
|
CURRENT_SHA=$(git rev-list -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$?
|
||||||
else
|
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=$?
|
CURRENT_SHA=$INPUT_SHA; exit_status=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -82,12 +88,20 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
||||||
|
PREVIOUS_SHA=""
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
|
||||||
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
|
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
|
||||||
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
|
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
||||||
@@ -110,7 +124,8 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
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
|
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
CURRENT_BRANCH=$TARGET_BRANCH
|
CURRENT_BRANCH=$TARGET_BRANCH
|
||||||
@@ -133,21 +148,26 @@ else
|
|||||||
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
||||||
|
|
||||||
echo "Fetching remote refs..."
|
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
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "false" ]]; then
|
||||||
git fetch --deepen="$depth" origin "$TARGET_BRANCH" HEAD;
|
# shellcheck disable=SC2086
|
||||||
depth=$((depth * 10))
|
git fetch $EXTRA_ARGS --depth="$INPUT_FETCH_DEPTH" origin +refs/heads/"$TARGET_BRANCH":refs/remotes/origin/"$TARGET_BRANCH"
|
||||||
max_depth=5000
|
git branch --track "$TARGET_BRANCH" origin/"$TARGET_BRANCH" 2>/dev/null || true
|
||||||
|
|
||||||
if [[ $depth -gt $max_depth ]]; then
|
depth=$INPUT_FETCH_DEPTH
|
||||||
echo "::error::Unable to find merge-base between $TARGET_BRANCH and HEAD."
|
|
||||||
fi
|
while [ -z "$( git merge-base "$TARGET_BRANCH" HEAD )" ]; do
|
||||||
done
|
# shellcheck disable=SC2086
|
||||||
|
git fetch $EXTRA_ARGS --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."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::debug::Getting HEAD SHA..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||||
@@ -178,10 +198,24 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||||
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
PREVIOUS_SHA=""
|
||||||
|
|
||||||
|
if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
|
||||||
|
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
||||||
|
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
|
||||||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user