Skip to content

Commit 666f654

Browse files
Update slack.yml
Signed-off-by: pontus <[email protected]>
1 parent 1027491 commit 666f654

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

.github/workflows/slack.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
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:
8-
- name: Get current star count
9-
run: |
10-
echo ::set-env name=STARS::$(curl --silent 'https://api.github.com/repos/layer5io/preview-layer5' -H 'Accept: application/vnd.github.preview' | jq '.watchers_count')
11-
- name: Notify slack
12-
env:
13-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
14-
uses: pullreminders/slack-action@master
15-
with:
16-
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"Someone just starred <new-repo>! (https://github.com/layer5io/preview-layer5/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+
- name: Notify Slack
19+
env:
20+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
21+
uses: pullreminders/slack-action@master
22+
with:
23+
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{ github.repository }}! (https://github.com/${{ github.repository }}/stargazers) Total ⭐️: ${{ env.STARS }}\"}'
24+
25+
good-first-issue-notify:
26+
if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only')
27+
name: Notify Slack for new good-first-issue
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Notify Slack
31+
env:
32+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
33+
uses: pullreminders/slack-action@master
34+
with:
35+
args: '{\"channel\":\"C019426UBNY\",\"type\":\"section\",\"text\":\":new: Good first issue up for grabs: ${{ github.event.issue.title }} - ${{ github.event.issue.html_url }} \"}'
36+

0 commit comments

Comments
 (0)