Skip to content

Commit e1cc634

Browse files
authored
Merge pull request #60 from RanitMukherjee/patch-2
Update slack.yml
2 parents eb20784 + c2e2c73 commit e1cc634

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

.github/workflows/slack.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
name: Slack Notify
2-
on:
2+
3+
on:
34
watch:
5+
types: [started]
46
issues:
5-
types: [labeled]
7+
types: [labeled]
8+
69
jobs:
710
star-notify:
811
if: github.event_name == 'watch'
912
name: Notify Slack on star
1013
runs-on: ubuntu-latest
1114
steps:
12-
- name: Get current star count
13-
run: |
14-
echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
15-
- name: Notify slack
16-
env:
17-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
18-
uses: pullreminders/slack-action@master
19-
with:
20-
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+
2129
good-first-issue-notify:
22-
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')
2331
name: Notify Slack for new good-first-issue
2432
runs-on: ubuntu-latest
2533
steps:
26-
- name: Notify slack
27-
env:
28-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
29-
uses: pullreminders/slack-action@master
34+
- name: Notify Slack
35+
uses: slackapi/slack-github-action@v2.1.1
3036
with:
31-
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

Comments
 (0)