Skip to content

Commit

Permalink
fix(ci): reg workflow alt approach to getting baseline sha (vectordot…
Browse files Browse the repository at this point in the history
  • Loading branch information
neuronull committed Jun 8, 2023
1 parent 2931542 commit f1e1ae3
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,9 @@ jobs:
smp-version: ${{ steps.experimental-meta.outputs.SMP_CRATE_VERSION }}
lading-version: ${{ steps.experimental-meta.outputs.LADING_VERSION }}
steps:

- uses: actions/checkout@v3

- name: Checkout PR (issue_comment)
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr checkout ${{ github.event.issue.number }}

- name: Get PR branch name (issue_comment)
id: get-pr-branch-name
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export BRANCH=$(git branch --show-current)
echo "BRANCH=${BRANCH}"
echo "BRANCH=${BRANCH}" >> $GITHUB_OUTPUT
- name: Checkout PR branch (issue_comment)
if: github.event_name == 'issue_comment'
uses: actions/checkout@v3
with:
# TODO: this can be done more elegantly in a follow-up by using a depth value and
# increasing it until the merge-base is found.
fetch-depth: 500
ref: "${{ steps.get-pr-branch-name.outputs.BRANCH }}"
fetch-depth: 1000

# If triggered by issue comment, the event payload doesn't directly contain the head and base sha from the PR.
# But, we can retrieve this info from some commands.
Expand All @@ -165,6 +141,8 @@ jobs:
export PR_NUMBER=${{ github.event.issue.number }}
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_OUTPUT
gh pr checkout ${{ github.event.issue.number }}
export BASELINE_SHA=$(git merge-base master HEAD)
echo "BASELINE_SHA=${BASELINE_SHA}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit f1e1ae3

Please sign in to comment.