diff --git a/.github/workflows/issue-comment.yml b/.github/workflows/issue-comment.yml index 7e78a2089..08af5c120 100644 --- a/.github/workflows/issue-comment.yml +++ b/.github/workflows/issue-comment.yml @@ -10,7 +10,23 @@ jobs: issues: write pull-requests: write steps: + - name: Check if issue has "question" label + id: check_stale + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { data: issue } = await github.rest.issues.get({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number + }); + const hasLabel = issue.labels.some(label => label.name === 'stale'); + return hasLabel; + # only remove the label if the issue is not stale, this prevents that this + # action removes the label when the automatic reminder message gets sent. - name: Remove `waiting for user response` label if exists + if: steps.check_stale.outputs.result == 'false' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }}