Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8356a01788 | ||
|
|
a84c8f54f9 | ||
|
|
a4f296d02e | ||
|
|
33eef1b0ed | ||
|
|
ae2404f72e | ||
|
|
3f045143ec | ||
|
|
0707f1b441 | ||
|
|
fbc9b61579 | ||
|
|
ac602e39b8 | ||
|
|
ef32360b2d | ||
|
|
4b60d05705 | ||
|
|
385d98db73 | ||
|
|
8c766cffe7 | ||
|
|
00cc8e59b9 | ||
|
|
56a1ce212a |
62
HISTORY.md
62
HISTORY.md
@@ -1,20 +1,43 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [Unreleased](https://github.com/tj-actions/changed-files/tree/HEAD)
|
## [v34.5.1](https://github.com/tj-actions/changed-files/tree/v34.5.1) (2022-12-05)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.5.0...HEAD)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.5.1)
|
||||||
|
|
||||||
|
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-12-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.5.0...v34)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- \[Feature\] Deprecate usage of `set-output` command and upgrade to environment variable [\#833](https://github.com/tj-actions/changed-files/issues/833)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- \[BUG\] set-output call is deprecated [\#831](https://github.com/tj-actions/changed-files/issues/831)
|
||||||
|
- Unable to find merge-base between master and HEAD\[BUG\] \<title\> [\#830](https://github.com/tj-actions/changed-files/issues/830)
|
||||||
|
- \[BUG\] Glob not matching changed files [\#829](https://github.com/tj-actions/changed-files/issues/829)
|
||||||
|
- \[BUG\] Wrong changed-files returned for forked PRs [\#714](https://github.com/tj-actions/changed-files/issues/714)
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
- Dependency Dashboard [\#27](https://github.com/tj-actions/changed-files/issues/27)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Updated README.md [\#838](https://github.com/tj-actions/changed-files/pull/838) ([jackton1](https://github.com/jackton1))
|
||||||
|
- fix: wrong changed files for forked prs [\#837](https://github.com/tj-actions/changed-files/pull/837) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#836](https://github.com/tj-actions/changed-files/pull/836) ([jackton1](https://github.com/jackton1))
|
||||||
|
- fix: determining the merge base [\#835](https://github.com/tj-actions/changed-files/pull/835) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore: fix typos [\#834](https://github.com/tj-actions/changed-files/pull/834) ([jackton1](https://github.com/jackton1))
|
||||||
|
- chore\(deps\): update tj-actions/auto-doc action to v1.5.0 [\#832](https://github.com/tj-actions/changed-files/pull/832) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- chore\(deps\): update peter-evans/create-pull-request action to v4.2.3 [\#828](https://github.com/tj-actions/changed-files/pull/828) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
|
- Upgraded to v34.5.0 [\#827](https://github.com/tj-actions/changed-files/pull/827) ([jackton1](https://github.com/jackton1))
|
||||||
|
- Updated README.md [\#826](https://github.com/tj-actions/changed-files/pull/826) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v34.5.0](https://github.com/tj-actions/changed-files/tree/v34.5.0) (2022-11-24)
|
## [v34.5.0](https://github.com/tj-actions/changed-files/tree/v34.5.0) (2022-11-24)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34...v34.5.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.4.4...v34.5.0)
|
||||||
|
|
||||||
## [v34](https://github.com/tj-actions/changed-files/tree/v34) (2022-11-24)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v34.4.4...v34)
|
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -234,7 +257,6 @@
|
|||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
- \[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\] 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)
|
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
@@ -495,7 +517,7 @@
|
|||||||
|
|
||||||
## [v30.0.0](https://github.com/tj-actions/changed-files/tree/v30.0.0) (2022-09-24)
|
## [v30.0.0](https://github.com/tj-actions/changed-files/tree/v30.0.0) (2022-09-24)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.9...v30.0.0)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29...v30.0.0)
|
||||||
|
|
||||||
**Fixed bugs:**
|
**Fixed bugs:**
|
||||||
|
|
||||||
@@ -511,13 +533,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.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...v29.0.9)
|
|
||||||
|
|
||||||
## [v29](https://github.com/tj-actions/changed-files/tree/v29) (2022-09-20)
|
## [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)
|
[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)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v29.0.8...v29.0.9)
|
||||||
|
|
||||||
**Implemented enhancements:**
|
**Implemented enhancements:**
|
||||||
|
|
||||||
@@ -1960,7 +1982,7 @@
|
|||||||
|
|
||||||
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
|
## [v7](https://github.com/tj-actions/changed-files/tree/v7) (2021-06-09)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v7)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v7)
|
||||||
|
|
||||||
**Closed issues:**
|
**Closed issues:**
|
||||||
|
|
||||||
@@ -1976,13 +1998,13 @@
|
|||||||
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
|
- Update tj-actions/sync-release-version action to v8.7 [\#86](https://github.com/tj-actions/changed-files/pull/86) ([renovate[bot]](https://github.com/apps/renovate))
|
||||||
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
|
- Upgraded to v6.3 [\#85](https://github.com/tj-actions/changed-files/pull/85) ([jackton1](https://github.com/jackton1))
|
||||||
|
|
||||||
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6...v6.3)
|
|
||||||
|
|
||||||
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
|
## [v6](https://github.com/tj-actions/changed-files/tree/v6) (2021-05-26)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6)
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.3...v6)
|
||||||
|
|
||||||
|
## [v6.3](https://github.com/tj-actions/changed-files/tree/v6.3) (2021-05-26)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/tj-actions/changed-files/compare/v6.2...v6.3)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
|||||||
@@ -173,8 +173,9 @@ runs:
|
|||||||
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 }}
|
||||||
GITHUB_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
GITHUB_EVENT_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||||
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
GITHUB_EVENT_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||||
|
GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
|
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
|
||||||
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
|
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
|
||||||
GITHUB_REFNAME: ${{ github.ref_name }}
|
GITHUB_REFNAME: ${{ github.ref_name }}
|
||||||
@@ -211,6 +212,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||||
GITHUB_BASE_REF: ${{ github.base_ref }}
|
GITHUB_BASE_REF: ${{ github.base_ref }}
|
||||||
|
GITHUB_EVENT_HEAD_REPO_FORK: ${{ github.event.pull_request.head.repo.fork }}
|
||||||
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
||||||
INPUT_FILES_PATTERN_FILE: ${{ steps.glob.outputs.paths-output-file }}
|
INPUT_FILES_PATTERN_FILE: ${{ steps.glob.outputs.paths-output-file }}
|
||||||
|
|||||||
40
diff-sha.sh
40
diff-sha.sh
@@ -7,14 +7,14 @@ GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
|||||||
EXTRA_ARGS="--no-tags"
|
EXTRA_ARGS="--no-tags"
|
||||||
PREVIOUS_SHA=""
|
PREVIOUS_SHA=""
|
||||||
CURRENT_SHA=""
|
CURRENT_SHA=""
|
||||||
MERGE_BASE_EXRTRA_ARGS=""
|
DIFF="..."
|
||||||
|
|
||||||
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
|
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
|
||||||
EXTRA_ARGS=""
|
EXTRA_ARGS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$GITHUB_HEAD_REPO_FORK" == "true" ]]; then
|
if [[ "$GITHUB_EVENT_HEAD_REPO_FORK" == "true" ]]; then
|
||||||
MERGE_BASE_EXRTRA_ARGS="--fork-point"
|
DIFF=".."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "::group::changed-files-diff-sha"
|
echo "::group::changed-files-diff-sha"
|
||||||
@@ -68,9 +68,9 @@ 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
|
||||||
CURRENT_SHA=$INPUT_SHA; exit_status=$?
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" 2>&1 && exit_status=$? || exit_status=$?
|
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH"
|
||||||
|
CURRENT_SHA=$INPUT_SHA; exit_status=$?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -131,9 +131,9 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH" 2>&1 && exit_status=$? || exit_status=$?
|
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH"
|
||||||
|
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "::debug::Target branch $TARGET_BRANCH..."
|
echo "::debug::Target branch $TARGET_BRANCH..."
|
||||||
@@ -204,14 +204,10 @@ else
|
|||||||
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git rev-parse origin/"$CURRENT_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PREVIOUS_SHA=$(git merge-base $MERGE_BASE_EXRTRA_ARGS "$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
if ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git merge-base "$PREVIOUS_SHA" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
fi
|
|
||||||
|
|
||||||
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -224,21 +220,23 @@ else
|
|||||||
depth=$INPUT_FETCH_DEPTH
|
depth=$INPUT_FETCH_DEPTH
|
||||||
max_depth=$INPUT_MAX_FETCH_DEPTH
|
max_depth=$INPUT_MAX_FETCH_DEPTH
|
||||||
|
|
||||||
while ! git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA"..."$CURRENT_SHA" 1>/dev/null 2>&1; do
|
for ((i=0; i<max_depth; i+=depth)); do
|
||||||
echo "Fetching $depth commits..."
|
echo "Fetching $depth commits..."
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH"
|
git fetch $EXTRA_ARGS -u --progress --deepen="$depth" origin +"$GITHUB_REF":refs/remotes/origin/"$CURRENT_BRANCH"
|
||||||
|
|
||||||
PREVIOUS_SHA=$(git merge-base $MERGE_BASE_EXRTRA_ARGS "$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$(git merge-base "$TARGET_BRANCH" "$CURRENT_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
if [[ $depth -gt $max_depth ]]; then
|
if git diff --name-only --ignore-submodules=all "$PREVIOUS_SHA$DIFF$CURRENT_SHA" 1>/dev/null 2>&1; then
|
||||||
echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_SHA"
|
break
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
depth=$((depth + 300))
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ((i >= max_depth)); then
|
||||||
|
echo "::error::Unable to locate a common ancestor between $TARGET_BRANCH and $CURRENT_SHA"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "::debug::Not a shallow clone, skipping merge-base check."
|
echo "::debug::Not a shallow clone, skipping merge-base check."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ INPUT_SEPARATOR="${INPUT_SEPARATOR//$'\r'/'%0D'}"
|
|||||||
GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
GITHUB_OUTPUT=${GITHUB_OUTPUT:-""}
|
||||||
DIFF="..."
|
DIFF="..."
|
||||||
|
|
||||||
if [[ -z $GITHUB_BASE_REF ]]; then
|
if [[ -z $GITHUB_BASE_REF || "$GITHUB_EVENT_HEAD_REPO_FORK" == "true" ]]; then
|
||||||
DIFF=".."
|
DIFF=".."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user