Skip to content

Commit 08047e4

Browse files
authored
chore: Update action labels (#178)
1 parent 9d37936 commit 08047e4

File tree

4 files changed

+38
-20
lines changed

4 files changed

+38
-20
lines changed

.github/workflows/issue_closed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ permissions:
1010
jobs:
1111
cleanup-labels:
1212
runs-on: ubuntu-latest
13-
if: ${{ (contains(github.event.issue.labels.*.name, 'pending-response') || contains(github.event.issue.labels.*.name, 'closing soon') || contains(github.event.issue.labels.*.name, 'pending-release')|| contains(github.event.issue.labels.*.name, 'pending-triage')) }}
13+
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, 'closing soon') || contains(github.event.issue.labels.*.name, 'pending-release')|| contains(github.event.issue.labels.*.name, 'pending-triage')) }}
1414
steps:
15-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
1615
- name: remove unnecessary labels after closing
1716
shell: bash
1817
env:
1918
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2019
ISSUE_NUMBER: ${{ github.event.issue.number }}
20+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
2121
run: |
22-
gh issue edit $ISSUE_NUMBER --remove-label "closing soon" --remove-label "pending-response" --remove-label "pending-release" --remove-label "pending-triage"
22+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "closing soon" --remove-label "pending-community-response" --remove-label "pending-maintainer-response" --remove-label "pending-release" --remove-label "pending-triage"
2323
2424
comment-visibility-warning:
2525
runs-on: ubuntu-latest

.github/workflows/issue_comment.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,39 @@ jobs:
88
notify:
99
runs-on: ubuntu-latest
1010
permissions: {}
11-
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
11+
if: ${{ !github.event.issue.pull_request }}
1212
steps:
1313
- name: Run webhook curl command
1414
env:
1515
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
1616
BODY: ${{ toJson(github.event.comment.body) }}
17-
COMMENT_URL: ${{github.event.comment.html_url}}
17+
COMMENT_URL: ${{ github.event.comment.html_url }}
18+
USER: ${{ github.event.comment.user.login }}
1819
shell: bash
19-
run: echo $BODY | sed "s/\\\n/. /g; s/\\\r//g; s/[^a-zA-Z0-9 &().,:]//g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"body":"{}", "issue":"'$COMMENT_URL'"}'
20+
run: echo $BODY | sed "s/\\\n/. /g; s/\\\r//g; s/[^a-zA-Z0-9 &().,:]//g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"body":"{}", "issue":"'$COMMENT_URL'", "user":"'$USER'"}'
2021

21-
remove-pending-response-label:
22+
adjust-labels:
2223
runs-on: ubuntu-latest
2324
permissions:
2425
issues: write
25-
if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending-response') }}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ISSUE_NUMBER: ${{ github.event.issue.number }}
29+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
2630
steps:
27-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
28-
- name: remove unnecessary labels after closing
31+
- name: remove pending-community-response when new comment received
32+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && !github.event.issue.pull_request }}
33+
shell: bash
34+
run: |
35+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-community-response"
36+
- name: add pending-maintainer-response when new community comment received
37+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
38+
shell: bash
39+
run: |
40+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
41+
- name: remove pending-maintainer-response when new owner/member comment received
42+
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
2943
shell: bash
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
ISSUE_NUMBER: ${{ github.event.issue.number }}
3344
run: |
34-
gh issue edit $ISSUE_NUMBER --remove-label "pending-response"
45+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response"
46+

.github/workflows/issue_labeled.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
remove-pending-triage-label:
88
runs-on: ubuntu-latest
9-
if: ${{ contains(fromJSON('["question", "bug", "feature-request", "improvement"]'), github.event.label.name) }}
9+
if: ${{ contains(fromJSON('["question", "bug", "feature-request"]'), github.event.label.name) }}
1010
permissions:
1111
issues: write
1212
steps:

.github/workflows/issue_opened.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,25 @@ jobs:
1818
shell: bash
1919
run: echo $ISSUE | sed 's/[^a-zA-Z0-9 &().,:]//g' | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"{}", "issueUrl":"'$ISSUE_URL'", "user":"'$USER'"}'
2020

21-
add-pending-triage-label:
21+
add-issue-opened-labels:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
issues: write
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
ISSUE_NUMBER: ${{ github.event.issue.number }}
28+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
2529
steps:
2630
- name: Add the pending-triage label
2731
shell: bash
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
ISSUE_NUMBER: ${{ github.event.issue.number }}
31-
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
3232
run: |
3333
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-triage"
34+
- name: Add the pending-maintainer-response label
35+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
36+
shell: bash
37+
run: |
38+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
39+
3440

3541
maintainer-opened:
3642
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)