Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Notify new issues with permission check #824

Merged
merged 4 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .codeflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ secure:
upstream_repository: coinbase/coinbase-wallet-sdk
operate:
slack_channels:
- "#wallet-sdk"
- "#wallet-squad-build"
- "#wallet-feedback"
28 changes: 14 additions & 14 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ jobs:
run: |
echo "skip=true" >> $GITHUB_ENV
echo "::error:: Spam label found."
# - name: Check write permission
# run: |
# permission=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPO/collaborators/$USER/permission | jq -r '.permission')
# if [ "$permission" != "admin" ] && [ "$permission" != "write" ]; then
# echo "::notice:: User $USER has $permission permission."
# exit 0
# fi
# echo "skip=true" >> $GITHUB_ENV
# echo "::error:: User $USER has $permission permission. No slack alert required."
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# REPO: ${{ github.repository }}
# USER: ${{ github.actor }}
- name: Check write permission
run: |
permission=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPO/collaborators/$USER/permission | jq -r '.permission')
if [ "$permission" != "admin" ] && [ "$permission" != "write" ]; then
echo "::notice:: User $USER has $permission permission."
exit 0
fi
echo "skip=true" >> $GITHUB_ENV
echo "::error:: User $USER has $permission permission. No slack alert required."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
USER: ${{ github.actor }}

parse-event-details:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Set channel and mention
run: |
if [${{ contains(join(github.event.issue.labels.*.name), 'type:') }}]; then
if ${{ contains(join(github.event.issue.labels.*.name), 'type:') }}; then
echo "channel=${{ env.CHANNEL_WALLET_FEEDBACK }}" >> $GITHUB_ENV
echo "mention=!subteam^${{ env.ON_CALL_WALLET }}" >> $GITHUB_ENV
else
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/slack_template.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*<{{url}}|{{title}}>*
> {{event}} on <https://github.com/{{repo}}|{{repo}}> by <https://github.com/{{author}}|{{author}}>
> Please review the issue and proceed with the appropriate steps outlined in the runbook: http://go/wallet-sdk-oncall-runbook cc <{{mention}}>
> Please review the issue and proceed with the appropriate steps outlined in the <http://go/wallet-sdk-oncall-runbook|runbook>
> cc <{{mention}}>