Skip to content

Commit d3c2af5

Browse files
authored
Update coq-timing-diff.yml
1 parent 77cdc00 commit d3c2af5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,25 @@ jobs:
6363
GH_TOKEN: ${{ github.token }}
6464
run: |
6565
# Get the current branch name
66-
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
66+
CURRENT_BRANCH=${{ github.event.inputs.target_branch || github.ref }}
6767
echo "Current branch: $CURRENT_BRANCH"
6868
6969
# Check if this is a PR
7070
# Check if this branch has an associated PR
7171
PR_NUMBER=$(gh pr list --repo mit-plv/fiat-crypto --head $CURRENT_BRANCH --json number --jq '.[0].number')
72+
git remote add upstream https://github.com/mit-plv/fiat-crypto.git
7273
if [[ -n "$PR_NUMBER" ]]; then
7374
# Get the base branch from the PR
7475
BASE_BRANCH=$(gh pr view $PR_NUMBER --json baseRefName --jq '.baseRefName')
7576
echo "This branch has PR #$PR_NUMBER from $CURRENT_BRANCH to $BASE_BRANCH"
7677
# Get the merge-base of the base branch and current commit
77-
BASE_SHA=$(git merge-base origin/$BASE_BRANCH $GITHUB_SHA)
78+
git fetch upstream $BASE_BRANCH
79+
BASE_SHA=$(git merge-base upstream/$BASE_BRANCH $GITHUB_SHA)
7880
else
7981
# For non-PRs, use merge-base of current branch and master as base_sha
8082
echo "This is not a PR, using merge-base with master"
81-
BASE_SHA=$(git merge-base origin/master $GITHUB_SHA)
83+
git fetch upstream master
84+
BASE_SHA=$(git merge-base upstream/master $GITHUB_SHA)
8285
fi
8386
8487
echo "Using base SHA: $BASE_SHA"

0 commit comments

Comments
 (0)