Skip to content

Commit 02052b3

Browse files
committed
feat(workflows): update condition for label sync job to include non-workflow calls
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
1 parent d68a088 commit 02052b3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/label-sync.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ permissions:
1818

1919
jobs:
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 }}

0 commit comments

Comments
 (0)