|
1 | 1 | name: Slack Notify |
2 | | -on: |
| 2 | + |
| 3 | +on: |
3 | 4 | watch: |
4 | 5 | types: [started] |
| 6 | + issues: |
| 7 | + types: [labeled] |
| 8 | + |
5 | 9 | jobs: |
6 | 10 | star-notify: |
7 | 11 | if: github.event_name == 'watch' |
8 | 12 | name: Notify Slack on star |
9 | 13 | runs-on: ubuntu-latest |
10 | 14 | steps: |
11 | | - - name: Get current star count |
12 | | - run: | |
13 | | - echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV |
14 | | - - name: Notify slack |
15 | | - env: |
16 | | - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
17 | | - uses: pullreminders/slack-action@master |
18 | | - with: |
19 | | - args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{env.STARS}}\"}' |
| 15 | + - name: Get current star count |
| 16 | + run: | |
| 17 | + echo "STARS=$(curl --silent 'https://api.github.com/repos/${{ github.repository }}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV |
| 18 | +
|
| 19 | + - name: Notify Slack |
| 20 | + uses: slackapi/slack-github-action@v2.1.1 |
| 21 | + with: |
| 22 | + method: chat.postMessage |
| 23 | + token: ${{ secrets.SLACK_BOT_TOKEN }} |
| 24 | + payload: | |
| 25 | + channel: CSK7N9TGX |
| 26 | + type: "mrkdwn" |
| 27 | + text: "<https://github.com/${{ github.actor }}|${{ github.actor }}> just starred <https://github.com/${{ github.repository }}/stargazers|${{ github.repository }}> bringing the total ⭐️ count up to: ${{ env.STARS }}" |
| 28 | +
|
20 | 29 | good-first-issue-notify: |
21 | | - if: github.event_name == 'issues' && github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only' |
| 30 | + if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only') |
22 | 31 | name: Notify Slack for new good-first-issue |
23 | 32 | runs-on: ubuntu-latest |
24 | 33 | steps: |
25 | | - - name: Notify slack |
26 | | - env: |
27 | | - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
28 | | - uses: pullreminders/slack-action@master |
| 34 | + - name: Notify Slack |
| 35 | + uses: slackapi/slack-github-action@v2.1.1 |
29 | 36 | with: |
30 | | - args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}' |
| 37 | + method: chat.postMessage |
| 38 | + token: ${{ secrets.SLACK_BOT_TOKEN }} |
| 39 | + payload: | |
| 40 | + channel: C019426UBNY |
| 41 | + text: ":new: Good first issue up for grabs: <${{ github.event.issue.title }}|${{ github.event.issue.html_url }}>" |
0 commit comments