Skip to content

Commit c8d458e

Browse files
committed
ci: Use branch name instead of ref
1 parent 778c9c5 commit c8d458e

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

.github/workflows/pr-comment.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ jobs:
4141
PR_NUMBER: ${{ github.event.issue.number }}
4242
NODE_ID: ${{ github.event.comment.node_id }}
4343

44-
- name: Get PR HEAD Ref
45-
id: getRef
46-
run: echo "pr_ref=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json headRefOid | jq -r '.headRefOid')" >> $GITHUB_OUTPUT
44+
- name: Get PR HEAD branch
45+
id: getBranch
46+
# This gets the PR's head ref name (aka branch)
47+
# We can't use the SHA or the default because of how this workflow is triggered
48+
run: echo "pr_branch=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
4749
env:
4850
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4951
PR_NUMBER: ${{ github.event.issue.number }}
@@ -52,7 +54,7 @@ jobs:
5254
uses: actions/checkout@v4
5355
with:
5456
fetch-depth: 0
55-
ref: ${{ steps.getRef.outputs.pr_ref }}
57+
ref: ${{ steps.getBranch.outputs.pr_branch }}
5658
token: ${{ secrets.PAT }}
5759

5860
- name: Run the regeneration

.github/workflows/regenerate-sample-data.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)