Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't remove label for the automatic message #9

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/issue-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@ on:
types: [ created ]

jobs:
remove-label:
remove-waiting-for-user-reponse:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Check labels of issue
id: check_labels
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 isStale = issue.labels.some(label => label.name === 'stale');
const waitingResponse = issue.labels.some(label => label.name === 'waiting for user response');
return !isStale && waitingResponse;
# 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_labels.outputs.result == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading