Skip to content

Commit 6c039dd

Browse files
committed
Fix label-sync to specify repo and add checkout step
1 parent 305a8fd commit 6c039dd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/label-sync.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
if: inputs.copy_issue_labels == true || github.event_name != 'workflow_call'
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v6
26+
2427
- name: Extract issue number from PR
2528
id: extract-issue
2629
env:
@@ -38,12 +41,13 @@ jobs:
3841
- name: Copy labels from issue to PR
3942
if: steps.extract-issue.outputs.issue_number != ''
4043
run: |
41-
LABELS=$(gh issue view "$ISSUE_NUM" --json labels --jq '.labels[].name')
44+
LABELS=$(gh issue view "$ISSUE_NUM" --repo "$REPO" --json labels --jq '.labels[].name')
4245
4346
for label in $LABELS; do
44-
gh pr edit "$PR_NUM" --add-label "$label" 2>/dev/null || true
47+
gh pr edit "$PR_NUM" --repo "$REPO" --add-label "$label" 2>/dev/null || true
4548
done
4649
env:
4750
ISSUE_NUM: ${{ steps.extract-issue.outputs.issue_number }}
4851
PR_NUM: ${{ github.event.pull_request.number }}
52+
REPO: ${{ github.repository }}
4953
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)