Skip to content

Commit 5a47c18

Browse files
Update slack.yml
Signed-off-by: Ranit Mukherjee <49058364+RanitMukherjee@users.noreply.github.com>
1 parent 5b7c38e commit 5a47c18

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

.github/workflows/slack.yml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
name: Slack Notify
2+
23
on:
34
watch:
4-
types:
5-
- started
5+
types: [started]
6+
issues:
7+
types: [labeled]
8+
69
jobs:
710
star-notify:
811
if: github.event_name == 'watch'
912
name: Notify Slack on star
10-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
1114
steps:
1215
- name: Get current star count
13-
run: >
14-
echo "STARS=$(curl --silent
15-
'https://api.github.com/repos/${{github.repository}}' -H 'Accept:
16-
application/vnd.github.preview' | jq '.stargazers_count')" >>
17-
$GITHUB_ENV
18-
- name: Notify slack
19-
env:
20-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
21-
uses: pullreminders/slack-action@master
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
2221
with:
23-
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred
24-
${{github.repository}}!
25-
(https://github.com/${{github.repository}}/stargazers) Total ⭐️:
26-
${{env.STARS}}\"}'
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+
2729
good-first-issue-notify:
28-
if: github.event_name == 'issues' && github.event.label.name == 'good first
29-
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')
3031
name: Notify Slack for new good-first-issue
31-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-latest
3233
steps:
33-
- name: Notify slack
34-
env:
35-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
36-
uses: pullreminders/slack-action@master
34+
- name: Notify Slack
35+
uses: slackapi/slack-github-action@v2.1.1
3736
with:
38-
args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just
39-
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

Comments
 (0)