Skip to content

Commit 41682f1

Browse files
authored
Do not try to remove stale label on PRs (#2601)
2 parents c9e170e + f618f5c commit 41682f1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/stale.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ jobs:
2323
days-before-stale: 30
2424
days-before-close: 5
2525
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.'
26-
stale-issue-label: $stale_label
26+
stale-issue-label: '${{ env.stale_label }}'
2727
exempt-issue-labels: 'internal, Fixed In Next Release, Bug, never-stale'
2828
exempt-all-issue-assignees: true
2929
operations-per-run: 300
3030
close-issue-reason: 'not_planned'
3131

32-
remove_stale: # trigger "stale" removal immediately when stale issues are commented on
33-
if: github.event_name == 'issue_comment'
32+
remove_stale:
33+
# trigger "stale" removal immediately when stale issues are commented on
34+
# we need to explicitly check that the trigger does not run on comment on a PR as
35+
# 'issue_comment' triggers on issues AND PR comments
36+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment-on-issues-only-or-pull-requests-only
37+
if: ${{ !github.event.issue.pull_request && github.event_name != 'schedule' }}
3438
permissions:
3539
contents: read # for actions/checkout
3640
issues: write # to edit issues label
@@ -39,6 +43,6 @@ jobs:
3943
- name: Checkout
4044
uses: actions/checkout@v3.4.0
4145
- name: Remove 'stale' label
42-
run: gh issue edit ${{ github.event.issue.number }} --remove-label $stale_label
46+
run: gh issue edit ${{ github.event.issue.number }} --remove-label ${{ env.stale_label }}
4347
env:
4448
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)