Skip to content

Commit f1e1ae3

Browse files
authored
fix(ci): reg workflow alt approach to getting baseline sha (#17645)
1 parent 2931542 commit f1e1ae3

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

.github/workflows/regression.yml

+3-25
Original file line numberDiff line numberDiff line change
@@ -126,33 +126,9 @@ jobs:
126126
smp-version: ${{ steps.experimental-meta.outputs.SMP_CRATE_VERSION }}
127127
lading-version: ${{ steps.experimental-meta.outputs.LADING_VERSION }}
128128
steps:
129-
130129
- uses: actions/checkout@v3
131-
132-
- name: Checkout PR (issue_comment)
133-
if: github.event_name == 'issue_comment'
134-
env:
135-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136-
run: gh pr checkout ${{ github.event.issue.number }}
137-
138-
- name: Get PR branch name (issue_comment)
139-
id: get-pr-branch-name
140-
if: github.event_name == 'issue_comment'
141-
env:
142-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143-
run: |
144-
export BRANCH=$(git branch --show-current)
145-
echo "BRANCH=${BRANCH}"
146-
echo "BRANCH=${BRANCH}" >> $GITHUB_OUTPUT
147-
148-
- name: Checkout PR branch (issue_comment)
149-
if: github.event_name == 'issue_comment'
150-
uses: actions/checkout@v3
151130
with:
152-
# TODO: this can be done more elegantly in a follow-up by using a depth value and
153-
# increasing it until the merge-base is found.
154-
fetch-depth: 500
155-
ref: "${{ steps.get-pr-branch-name.outputs.BRANCH }}"
131+
fetch-depth: 1000
156132

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

0 commit comments

Comments
 (0)