Skip to content

Commit

Permalink
#0: Added github community issue workflow (#9833)
Browse files Browse the repository at this point in the history
* #0: Added github community issue workflow

* #0: Update channel id

* #0: Check that webhook works

* #0: Try to log some more

* #0: Change the check

* #0: switched check to an org member

* #0: Add label: community to non-org issues

* #0: Switch to org check + labels addition
  • Loading branch information
ayerofieiev-tt authored Jun 28, 2024
1 parent 2cc5380 commit 29efc68
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/on-community-issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Slack Notification on Community Issue"

on:
issues:
types: [opened, labeled]

jobs:
label-check:
runs-on: ubuntu-latest

steps:
- name: Check if organization member
id: is_organization_member
uses: JamesSingleton/[email protected]
with:
organization: tenstorrent
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Add community label
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: community
- name: Send Slack Notification
if: ${{ steps.is_organization_member.outputs.result == 'false' }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": "A new issue has been created by a non-org member `${{ github.event.sender.login }}`: ${{ github.event.issue.html_url }}",
"channel": "C07AZJ5DLL8"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CHANNEL_WEBHOOK_URL }}

0 comments on commit 29efc68

Please sign in to comment.