Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): reg workflow alt approach to getting baseline sha #17645

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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