Skip to content

Commit 22588a3

Browse files
gh-146488: find correct merge base in check-html-ids
1 parent 9e5b838 commit 22588a3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/reusable-check-html-ids.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 30
1717
steps:
18-
- name: 'Check out base commit'
18+
- name: 'Find merge base'
19+
id: merge-base
20+
env:
21+
GH_TOKEN: ${{ github.token }}
22+
run: |
23+
MERGE_BASE=$(gh api repos/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --jq '.merge_base_commit.sha')
24+
echo "sha=$MERGE_BASE" >> "$GITHUB_OUTPUT"
25+
- name: 'Check out merge base'
1926
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2027
with:
2128
persist-credentials: false
22-
ref: ${{ github.event.pull_request.base.sha }}
29+
ref: ${{ steps.merge-base.outputs.sha }}
2330
- name: 'Set up Python'
2431
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2532
with:

0 commit comments

Comments
 (0)