Skip to content

Commit 8a3d8aa

Browse files
authored
Merge pull request #52 from RanitMukherjee/patch-2
Update slack.yml
2 parents e809e82 + fe9c42f commit 8a3d8aa

File tree

1 file changed

+33
-8
lines changed

1 file changed

+33
-8
lines changed

.github/workflows/slack.yml

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
1-
name: Slack Notify on Star
2-
on: watch
1+
name: Slack Notify
2+
3+
on:
4+
watch:
5+
types: [started]
6+
issues:
7+
types: [labeled]
8+
39
jobs:
410
star-notify:
11+
if: github.event_name == 'watch'
512
name: Notify Slack on star
613
runs-on: ubuntu-latest
714
steps:
815
- name: Get current star count
916
run: |
10-
echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
11-
- name: Notify slack
12-
env:
13-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
14-
uses: pullreminders/slack-action@master
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/[email protected]
1521
with:
16-
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{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+
29+
good-first-issue-notify:
30+
if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only')
31+
name: Notify Slack for new good-first-issue
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Notify Slack
35+
uses: slackapi/[email protected]
36+
with:
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)