|
| 1 | +name: Issue Opened |
| 2 | + |
| 3 | +on: |
| 4 | + issues: |
| 5 | + types: [opened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + notify: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + permissions: {} |
| 11 | + if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }} |
| 12 | + steps: |
| 13 | + - name: Run webhook curl command |
| 14 | + env: |
| 15 | + WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }} |
| 16 | + ISSUE: ${{toJson(github.event.issue.title)}} |
| 17 | + ISSUE_URL: ${{github.event.issue.html_url}} |
| 18 | + USER: ${{github.event.issue.user.login}} |
| 19 | + shell: bash |
| 20 | + 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'"}' |
| 21 | + |
| 22 | + add-issue-opened-labels: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + issues: write |
| 26 | + env: |
| 27 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 29 | + REPOSITORY_NAME: ${{ github.event.repository.full_name }} |
| 30 | + steps: |
| 31 | + - name: Add the pending-triage label |
| 32 | + shell: bash |
| 33 | + run: | |
| 34 | + gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-triage" |
| 35 | + - name: Add the pending-maintainer-response label |
| 36 | + if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }} |
| 37 | + shell: bash |
| 38 | + run: | |
| 39 | + gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response" |
| 40 | + |
| 41 | + |
| 42 | + maintainer-opened: |
| 43 | + runs-on: ubuntu-latest |
| 44 | + permissions: |
| 45 | + issues: write |
| 46 | + if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }} |
| 47 | + steps: |
| 48 | + - name: Post comment if maintainer opened. |
| 49 | + shell: bash |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + ISSUE_NUMBER: ${{ github.event.issue.number }} |
| 53 | + REPOSITORY_NAME: ${{ github.event.repository.full_name }} |
| 54 | + run: | |
| 55 | + 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