ci: manage waiting for feedback label (#32577)
This commit is contained in:
parent
b46b5f38f4
commit
44b8a5cf0e
2 changed files with 49 additions and 1 deletions
14
.github/workflows/stale.yaml
vendored
14
.github/workflows/stale.yaml
vendored
|
|
@ -20,5 +20,17 @@ jobs:
|
|||
with:
|
||||
days-before-stale: 7
|
||||
days-before-close: 5
|
||||
exempt-issue-labels: "pinned,security,backlog,bug"
|
||||
exempt-issue-labels: "pinned,security,backlog,bug,waiting for feedback"
|
||||
exempt-pr-labels: "pinned,security,backlog,bug"
|
||||
|
||||
# issues without the requested feedback close after a week
|
||||
- uses: actions/stale@v11
|
||||
id: waiting
|
||||
with:
|
||||
only-issue-labels: "waiting for feedback"
|
||||
days-before-issue-stale: 7
|
||||
days-before-issue-close: 0
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
exempt-issue-labels: "pinned,security,backlog"
|
||||
close-issue-message: "Closing since the requested feedback was not provided. You can still comment with requested feedback and we'll reopen."
|
||||
|
|
|
|||
36
.github/workflows/waiting-feedback.yml
vendored
Normal file
36
.github/workflows/waiting-feedback.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Waiting Feedback
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
pull_request_review_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
reset-label:
|
||||
name: Reset Waiting Label
|
||||
runs-on: ubuntu-latest
|
||||
# only when the opener replies
|
||||
if: github.event.comment.user.login == (github.event.issue.user.login || github.event.pull_request.user.login)
|
||||
|
||||
steps:
|
||||
- uses: actions/github-script@v9.0.0
|
||||
with:
|
||||
script: |
|
||||
const number = (context.payload.issue || context.payload.pull_request).number;
|
||||
|
||||
try {
|
||||
await github.rest.issues.removeLabel({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: number,
|
||||
name: 'waiting for feedback',
|
||||
});
|
||||
} catch (err) {
|
||||
// label not present
|
||||
if (err.status !== 404) throw err;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue