File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,19 +18,19 @@ permissions:
1818
1919jobs :
2020 copy-issue-labels :
21- if : inputs.copy_issue_labels == true
21+ if : inputs.copy_issue_labels == true || github.event_name != 'workflow_call'
2222 runs-on : ubuntu-latest
2323 steps :
2424 - name : Extract issue number from PR
2525 id : extract-issue
2626 run : |
2727 BODY='${{ github.event.pull_request.body }}'
2828 TITLE='${{ github.event.pull_request.title }}'
29-
29+
3030 ISSUE=$(echo "$BODY $TITLE" | \
3131 grep -oE '(closes|fixes|resolves|addresses)\s+#[[:digit:]]+' | \
3232 grep -oE '#[[:digit:]]+' | head -1 | tr -d '#')
33-
33+
3434 if [ -n "$ISSUE" ]; then
3535 echo "issue_number=$ISSUE" >> "$GITHUB_OUTPUT"
3636 fi
@@ -40,11 +40,11 @@ jobs:
4040 run : |
4141 ISSUE_NUM=${{ steps.extract-issue.outputs.issue_number }}
4242 PR_NUM=${{ github.event.pull_request.number }}
43-
43+
4444 LABELS=$(gh issue view "$ISSUE_NUM" --json labels --jq '.labels[].name')
45-
45+
4646 for label in $LABELS; do
4747 gh pr edit "$PR_NUM" --add-label "$label" 2>/dev/null || true
4848 done
4949 env :
50- GH_TOKEN : ${{ github.token }}
50+ GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments