Skip to content

Commit ef4dd8a

Browse files
committed
Don't die on missing fetch
1 parent ee8fca9 commit ef4dd8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/coq-timing-diff.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,24 @@ jobs:
7070
if [[ -n "${{ github.event.inputs.target_repository }}" && "${{ github.event.inputs.target_repository }}" != "${{ github.repository }}" ]]; then
7171
echo "Adding remote for target repository: ${{ github.event.inputs.target_repository }}"
7272
git remote add target_repo "https://github.com/${{ github.event.inputs.target_repository }}.git"
73+
git fetch target_repo $CURRENT_BRANCH || true
7374
git checkout -b $CURRENT_BRANCH target_repo/$CURRENT_BRANCH
7475
else
76+
git fetch origin $CURRENT_BRANCH || true
7577
git checkout -b $CURRENT_BRANCH origin/$CURRENT_BRANCH
7678
fi
7779
if [[ -n "$PR_NUMBER" ]]; then
7880
# Get the base branch from the PR
7981
BASE_BRANCH=$(gh pr view $PR_NUMBER --json baseRefName --jq '.baseRefName')
8082
echo "This branch has PR #$PR_NUMBER from $CURRENT_BRANCH to $BASE_BRANCH"
8183
# Get the merge-base of the base branch and current commit
82-
git fetch origin $BASE_BRANCH
84+
git fetch origin $BASE_BRANCH || true
8385
BASE_SHA=$(git merge-base target_repo/$BASE_BRANCH $CURRENT_BRANCH)
8486
8587
else
8688
# For non-PRs, use merge-base of current branch and master as base_sha
8789
echo "This is not a PR, using merge-base with master"
88-
git fetch origin master
90+
git fetch origin master || true
8991
BASE_SHA=$(git merge-base master $CURRENT_BRANCH)
9092
fi
9193

0 commit comments

Comments
 (0)