-
Notifications
You must be signed in to change notification settings - Fork 216
chore: Update label actions #3807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
notify: | ||
runs-on: ubuntu-latest | ||
permissions: {} | ||
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }} | ||
if: ${{ !github.event.issue.pull_request }} | ||
steps: | ||
- name: Run webhook curl command | ||
env: | ||
|
@@ -19,17 +19,27 @@ jobs: | |
shell: bash | ||
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'"}' | ||
|
||
remove-pending-response-label: | ||
adjust-labels: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending-response') }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
REPOSITORY_NAME: ${{ github.event.repository.full_name }} | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 | ||
- name: remove unnecessary labels after closing | ||
- name: remove pending-community-response when new 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) }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC for this filter to work you will need to set your aws-amplify org membership visibility to Public, otherwise the runner won't be able to see it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no different than the filter above that was already being used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, everybody in the Swift team made their membership public in order for this to work. You guys in the Android team will probably need to do the same. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, I don't remember doing this but we can check. We've had this type of filter used in other places and working well, so maybe we had already done that as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! I might be mixing things up with the ops metrics lambda needing this permission instead of the GH action 😅 |
||
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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
run: | | ||
gh issue edit $ISSUE_NUMBER --remove-label "pending-response" | ||
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rather keep this filter to avoid sending notifications for comments from maintainers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if statement was moved down to each of the steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
notify
job only has one step, which just runs the command. Unless i'm blatantly missing something 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, correct.
If you all would prefer, I can remove it. I brought this up with the Android team and we decided to remove it because we wanted to still be notified when a maintainer opened a new issue. This ensures everyone is aware of the issue coming in, not just the person that created it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this action is for comments being added to issues, not for issues being opened.
I also very much like not being notified for comments from us :P.
But we can check with the team as well