Skip to content

Commit a32a671

Browse files
authored
chore: Update action labels (#3625)
* Update action labels * Update action labels
1 parent ec14102 commit a32a671

File tree

5 files changed

+152
-30
lines changed

5 files changed

+152
-30
lines changed

.github/workflows/issue_closed.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Issue Closed
2+
3+
on:
4+
issues:
5+
types: [closed]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
cleanup-labels:
12+
runs-on: ubuntu-latest
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')) }}
14+
steps:
15+
- name: remove unnecessary labels after closing
16+
shell: bash
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
ISSUE_NUMBER: ${{ github.event.issue.number }}
20+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
21+
run: |
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"
23+
24+
comment-visibility-warning:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: aws-actions/closed-issue-message@36b7048ea77bb834d16e7a7c5b5471ac767a4ca1 # v1
28+
with:
29+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
30+
message: |
31+
This issue is now closed. Comments on closed issues are hard for our team to see.
32+
If you need more assistance, please open a new issue that references this one.

.github/workflows/issue_comment.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Issue Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
notify:
9+
runs-on: ubuntu-latest
10+
permissions: {}
11+
if: ${{ !github.event.issue.pull_request }}
12+
steps:
13+
- name: Run webhook curl command
14+
env:
15+
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
16+
BODY: ${{ toJson(github.event.comment.body) }}
17+
COMMENT_URL: ${{ github.event.comment.html_url }}
18+
USER: ${{ github.event.comment.user.login }}
19+
shell: bash
20+
run: echo $BODY | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"body":"{}", "issue":"'$COMMENT_URL'", "user":"'$USER'"}'
21+
22+
adjust-labels:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
issues: write
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ISSUE_NUMBER: ${{ github.event.issue.number }}
29+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
30+
steps:
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) }}
43+
shell: bash
44+
run: |
45+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response"
46+

.github/workflows/issue_labeled.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Issue Labeled
2+
on:
3+
issues:
4+
types: [labeled]
5+
6+
jobs:
7+
remove-pending-triage-label:
8+
runs-on: ubuntu-latest
9+
if: ${{ contains(fromJSON('["question", "bug", "feature-request"]'), github.event.label.name) }}
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: Remove the pending-triage label
14+
shell: bash
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
ISSUE_NUMBER: ${{ github.event.issue.number }}
18+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
19+
run: |
20+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-triage"

.github/workflows/issue_opened.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Issue Opened
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
jobs:
7+
notify:
8+
runs-on: ubuntu-latest
9+
permissions: {}
10+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
11+
steps:
12+
- name: Run webhook curl command
13+
env:
14+
WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }}
15+
ISSUE: ${{toJson(github.event.issue.title)}}
16+
ISSUE_URL: ${{github.event.issue.html_url}}
17+
USER: ${{github.event.issue.user.login}}
18+
shell: bash
19+
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'"}'
20+
21+
add-issue-opened-labels:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
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 }}
29+
steps:
30+
- name: Add the pending-triage label
31+
shell: bash
32+
run: |
33+
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+
40+
41+
maintainer-opened:
42+
runs-on: ubuntu-latest
43+
permissions:
44+
issues: write
45+
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
46+
steps:
47+
- name: Post comment if maintainer opened.
48+
shell: bash
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
ISSUE_NUMBER: ${{ github.event.issue.number }}
52+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
53+
run: |
54+
gh issue comment $ISSUE_NUMBER --repo $REPOSITORY_NAME -b "This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly."

.github/workflows/notify_comments.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)