Skip to content

Commit

Permalink
chore: Change pending-triage label to pending-maintainer-response (#5803
Browse files Browse the repository at this point in the history
)

* chore: change pending-triage label to pending-maintainer-response

* chore: add GitHub workflows to add / remove triaging labels when necessary
  • Loading branch information
jordanvn authored Sep 19, 2024
1 parent 0ddeea9 commit 15745e0
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/issue-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Description: This workflow automatically removes triage labels from issues that have been closed
#
# Triggered by: closing issues

name: Issue Closed

on:
issues:
types: [closed]

jobs:
clean_labels:
runs-on: ubuntu-latest

permissions:
issues: write

if: ${{ (contains(github.event.issue.labels.*.name, 'pending-community-response') || contains(github.event.issue.labels.*.name, 'pending-maintainer-response') || contains(github.event.issue.labels.*.name, 'pending-triage')) }}
steps:
- name: Remove unnecessary labels after closing
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-community-response" --remove-label "pending-maintainer-response" --remove-label "pending-triage"
38 changes: 38 additions & 0 deletions .github/workflows/issue-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Description: This workflow automatically adds appropriate labels to issues that have been commented on
#
# Triggered by: a new comment being added to an issue

name: Issue Comment

on:
issue_comment:
types: [created]

jobs:
adjust_labels:
runs-on: ubuntu-latest

permissions:
issues: write

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
REPOSITORY_NAME: ${{ github.event.repository.full_name }}

steps:
- name: Remove pending-community-response when new community comment received
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && !github.event.issue.pull_request }}
shell: bash
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-community-response"
- name: Add pending-maintainer-response when new community comment received
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
shell: bash
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
- name: Remove pending-maintainer-response when new owner/member comment received
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
shell: bash
run: |
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response"
4 changes: 2 additions & 2 deletions .github/workflows/label-new-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
- name: Add pending-triage label
- name: Add pending-maintainer-response label
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -33,4 +33,4 @@ jobs:
echo "Issue number must be a positive integer"
exit 1
fi
gh issue edit $ISSUE_NUMBER_INT --add-label 'pending-triage'
gh issue edit $ISSUE_NUMBER_INT --add-label 'pending-maintainer-response'

0 comments on commit 15745e0

Please sign in to comment.