Skip to content

Commit

Permalink
Merge pull request Expensify#51351 from margelo/e2e/properly-detect-b…
Browse files Browse the repository at this point in the history
…aseline

[NoQA] e2e: properly detect baseline commit (when running from PR)
  • Loading branch information
nkuoch authored Oct 25, 2024
2 parents 3a834f4 + 77e6643 commit d5e4824
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ jobs:
- name: Determine "baseline ref" (prev merge commit)
id: getBaselineRef
run: |
previous_merge=$(git rev-list --merges HEAD~1 | head -n 1)
git checkout "$previous_merge"
# Get the name of the current branch
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$current_branch" = "main" ]; then
# On the main branch, find the previous merge commit
previous_merge=$(git rev-list --merges HEAD~1 | head -n 1)
else
# On a feature branch, find the common ancestor of the current branch and main
previous_merge=$(git merge-base HEAD main)
fi
echo "$previous_merge"
echo "BASELINE_REF=$previous_merge" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit d5e4824

Please sign in to comment.