chore: add back ability to fetch branch history
This commit is contained in:
parent
3b54ee8a34
commit
1b438493cf
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
@ -136,15 +136,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Run changed-files with a single commit history
|
- name: Run changed-files with a single commit history
|
||||||
id: changed-files
|
id: changed-files
|
||||||
continue-on-error: true
|
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|
||||||
- name: Exit with 1 if no error is raised
|
|
||||||
if: github.event_name == 'pull_request' && steps.changed-files.outcome != 'failure'
|
|
||||||
run: |
|
|
||||||
echo "Expected: (failure) got ${{ steps.changed-files.outcome }}"
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- name: Show output
|
- name: Show output
|
||||||
run: |
|
run: |
|
||||||
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
echo '${{ toJSON(steps.changed-files.outputs) }}'
|
||||||
|
@ -62,6 +62,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||||
|
git fetch --no-tags -u --progress origin --depth=2 "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
|
||||||
PREVIOUS_SHA=""
|
PREVIOUS_SHA=""
|
||||||
|
|
||||||
if [[ "$GITHUB_EVENT_FORCED" == "false" ]]; then
|
if [[ "$GITHUB_EVENT_FORCED" == "false" ]]; then
|
||||||
@ -105,9 +106,11 @@ else
|
|||||||
echo "::debug::GITHUB_BASE_REF: $TARGET_BRANCH..."
|
echo "::debug::GITHUB_BASE_REF: $TARGET_BRANCH..."
|
||||||
|
|
||||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||||
|
git fetch --no-tags -u --progress origin --depth=1 "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
|
||||||
PREVIOUS_SHA=$GITHUB_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
PREVIOUS_SHA=$GITHUB_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$?
|
||||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||||
else
|
else
|
||||||
|
git fetch --no-tags -u --progress origin --depth=1 "$(git rev-parse --verify "$INPUT_BASE_SHA")" && exit_status=$? || exit_status=$?
|
||||||
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=$?
|
||||||
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
echo "::debug::Previous SHA: $PREVIOUS_SHA"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user