mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-06 19:41:20 +00:00
Merge pull request #786 from tj-actions/fix/bug-with-invalid-branch-name
This commit is contained in:
commit
6326c61a70
2 changed files with 5 additions and 6 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -127,9 +127,9 @@ jobs:
|
||||||
until: "2022-08-20"
|
until: "2022-08-20"
|
||||||
|
|
||||||
- name: Check output
|
- 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: |
|
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
|
exit 1
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
|
|
@ -45,8 +45,6 @@ fi
|
||||||
|
|
||||||
if [[ -z $GITHUB_BASE_REF ]]; then
|
if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
echo "Running on a push event..."
|
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..."
|
echo "::debug::Getting HEAD SHA..."
|
||||||
if [[ -n "$INPUT_UNTIL" ]]; then
|
if [[ -n "$INPUT_UNTIL" ]]; then
|
||||||
|
@ -67,6 +65,9 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
fi
|
fi
|
||||||
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"
|
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=$?
|
git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
|
@ -127,8 +128,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
git fetch $EXTRA_ARGS -u --progress --deepen="$INPUT_FETCH_DEPTH"
|
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=$?
|
|
||||||
CURRENT_BRANCH=$TARGET_BRANCH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "::debug::Target branch $TARGET_BRANCH..."
|
echo "::debug::Target branch $TARGET_BRANCH..."
|
||||||
|
|
Loading…
Add table
Reference in a new issue