Community issue test #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |