Skip to content

Commit fd77172

Browse files
committed
Update label actions
1 parent 00aac42 commit fd77172

File tree

4 files changed

+65
-14
lines changed

4 files changed

+65
-14
lines changed

.github/workflows/issue_closed.yml

Lines changed: 4 additions & 4 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')) }}
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"
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
@@ -30,4 +30,4 @@ jobs:
3030
message: |
3131
This issue is now closed. Comments on closed issues are hard for our team to see.
3232
If you need more assistance, please open a new issue that references this one.
33-
If you wish to keep having a conversation with other community members under this issue feel free to do so.
33+
If you wish to keep having a conversation with other community members under this issue feel free to do so.

.github/workflows/issue_comment.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ 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:
@@ -19,17 +19,27 @@ jobs:
1919
shell: bash
2020
run: echo $COMMENT | 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 '{"comment":"{}", "commentUrl":"'$COMMENT_URL'", "user":"'$USER'"}'
2121

22-
remove-pending-response-label:
22+
adjust-labels:
2323
runs-on: ubuntu-latest
2424
permissions:
2525
issues: write
26-
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 }}
2730
steps:
28-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
29-
- 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) }}
3043
shell: bash
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
ISSUE_NUMBER: ${{ github.event.issue.number }}
3444
run: |
35-
gh issue edit $ISSUE_NUMBER --remove-label "pending-response"
45+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response"

.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: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ 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-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+
2141
maintainer-opened:
2242
runs-on: ubuntu-latest
2343
permissions:
@@ -29,5 +49,6 @@ jobs:
2949
env:
3050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3151
ISSUE_NUMBER: ${{ github.event.issue.number }}
52+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
3253
run: |
33-
gh issue comment $ISSUE_NUMBER --repo aws-amplify/amplify-swift -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."
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."

0 commit comments

Comments
 (0)