Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2e030b6ed | ||
|
|
1b73c818fe | ||
|
|
a2913c1b3d | ||
|
|
95f386689b | ||
|
|
6ba3c59bc6 | ||
|
|
e65822d31a | ||
|
|
866ffdf84d | ||
|
|
338a11e8c5 | ||
|
|
6a0f4e7f4d | ||
|
|
dee73a71be | ||
|
|
9b079a7363 | ||
|
|
ac593b977e | ||
|
|
5b43f91839 | ||
|
|
ece8e1f566 | ||
|
|
cfbf2ee2ea | ||
|
|
6042b819eb | ||
|
|
367c547d7d | ||
|
|
6ac1087775 | ||
|
|
2982c7c1d0 | ||
|
|
a3a62da413 | ||
|
|
958d453c5d | ||
|
|
0f09389954 | ||
|
|
dc104b5c83 | ||
|
|
97e67238ea | ||
|
|
ac72938f3a | ||
|
|
133f857c90 | ||
|
|
3e8708a684 | ||
|
|
90a4d2a19b | ||
|
|
251c03879a | ||
|
|
ae5f032774 | ||
|
|
dd6f3c9e10 | ||
|
|
84396edc7e | ||
|
|
6079b26874 | ||
|
|
b94eca1419 | ||
|
|
a14ccf053e | ||
|
|
1fd624717d | ||
|
|
dca71d6aaa | ||
|
|
441dd9f254 | ||
|
|
6e95ff3cd5 | ||
|
|
a4d7180f07 | ||
|
|
8890344e49 | ||
|
|
d3f15b49f1 | ||
|
|
8227e3155d |
23
.github/workflows/test.yml
vendored
23
.github/workflows/test.yml
vendored
@@ -425,6 +425,27 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with dir_names specific
|
||||||
|
id: changed-files-dir-names-specific
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
base_sha: d1c0ee4
|
||||||
|
sha: 4d04215
|
||||||
|
fetch_depth: 60000
|
||||||
|
dir_names: "true"
|
||||||
|
files: test/**
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-dir-names-specific.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
- name: Check dir_names output
|
||||||
|
if: "!contains(steps.changed-files-dir-names-specific.outputs.all_changed_files, 'test')"
|
||||||
|
run: |
|
||||||
|
echo "Invalid output: Expected to include (test) got (${{ steps.changed-files-dir-names-specific.outputs.all_changed_files }})"
|
||||||
|
exit 1
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with forward slash separator
|
- name: Run changed-files with forward slash separator
|
||||||
id: changed-files-forward-slash
|
id: changed-files-forward-slash
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -878,10 +899,12 @@ 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'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
sha: ${{ github.event.pull_request.head.sha }}
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Show output
|
- name: Show output
|
||||||
|
if: github.event.action != 'closed'
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
|
|||||||
69
HISTORY.md
69
HISTORY.md
@@ -1,12 +1,47 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] dir\_names + files combo ends up in error [\#757](https://github.com/tj-actions/changed-files/issues/757)
|
||||||
|
|
||||||
|
**Closed issues:**
|
||||||
|
|
||||||
|
- \[BUG\] Action failing on PR with "Unable to find merge-base in shallow clone. Please increase 'max\_fetch\_depth' to at least 340." [\#755](https://github.com/tj-actions/changed-files/issues/755)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Updated README.md [\#762](https://github.com/tj-actions/changed-files/pull/762) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: fixed test [\#761](https://github.com/tj-actions/changed-files/pull/761) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: update env [\#760](https://github.com/tj-actions/changed-files/pull/760) ([jackton1](https://github.com/jackton1))
|
||||||
|
- fix: error finding merge-base [\#759](https://github.com/tj-actions/changed-files/pull/759) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: improve test coverage [\#758](https://github.com/tj-actions/changed-files/pull/758) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#756](https://github.com/tj-actions/changed-files/pull/756) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v34.1.1 [\#754](https://github.com/tj-actions/changed-files/pull/754) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
|
## [v34.1.1](https://github.com/tj-actions/changed-files/tree/v34.1.1) (2022-11-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.1.0...v34.1.1)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Upgraded to v34.1.0 [\#753](https://github.com/tj-actions/changed-files/pull/753) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v34.1.0 [\#752](https://github.com/tj-actions/changed-files/pull/752) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#751](https://github.com/tj-actions/changed-files/pull/751) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Upgraded to v34.0.5 [\#749](https://github.com/tj-actions/changed-files/pull/749) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: update test [\#746](https://github.com/tj-actions/changed-files/pull/746) ([jackton1](https://github.com/jackton1))
|
||||||
|
- fix: including changed files from merge commits, no merge-base found [\#736](https://github.com/tj-actions/changed-files/pull/736) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v34.1.0](https://github.com/tj-actions/changed-files/tree/v34.1.0) (2022-11-04)
|
## [v34.1.0](https://github.com/tj-actions/changed-files/tree/v34.1.0) (2022-11-04)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.1.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.0.5...v34.1.0)
|
||||||
|
|
||||||
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-04)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.0.5...v34)
|
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -1158,7 +1193,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/v12.2...v13)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v2.0.1...v13)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1177,13 +1212,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)
|
||||||
|
|
||||||
## [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/v2.0.1...v12.2)
|
|
||||||
|
|
||||||
## [v2.0.1](https://github.com/tj-actions/changed-files/tree/v2.0.1) (2021-12-30)
|
## [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)
|
[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)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
@@ -1224,7 +1259,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.9...v12)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v11...v12)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1242,13 +1277,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.9](https://github.com/tj-actions/changed-files/tree/v11.9) (2021-12-04)
|
|
||||||
|
|
||||||
[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)
|
## [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)
|
[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)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v1.3.1...v11.9)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ Support this project with a :star:
|
|||||||
| 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 | `"30"` | Limit depth of target 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. |
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
fetch_depth:
|
fetch_depth:
|
||||||
description: "Limit depth of target 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: "30"
|
default: "40"
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
added_files:
|
added_files:
|
||||||
@@ -158,6 +158,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_SERVER_URL: ${{ github.server_url }}
|
GITHUB_SERVER_URL: ${{ github.server_url }}
|
||||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||||
|
GITHUB_REF: ${{ github.ref }}
|
||||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||||
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
GITHUB_HEAD_REF: ${{ github.head_ref }}
|
||||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||||
|
|||||||
18
diff-sha.sh
18
diff-sha.sh
@@ -82,7 +82,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH"
|
|
||||||
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
if [[ -z "$PREVIOUS_SHA" ]]; then
|
||||||
@@ -134,8 +133,21 @@ else
|
|||||||
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
||||||
|
|
||||||
echo "Fetching remote refs..."
|
echo "Fetching remote refs..."
|
||||||
git fetch --no-tags -u --progress --deepen=40000
|
|
||||||
git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH"
|
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
|
||||||
|
|
||||||
echo "::debug::Getting HEAD SHA..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user