From 01ea6b95938c9e51377f7d9a2ec378c215748513 Mon Sep 17 00:00:00 2001 From: Joscha <34318751+josxha@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:41:35 +0100 Subject: [PATCH] Update issue-comment.yml --- .github/workflows/issue-comment.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 }}