Skip to content

Commit e9cdead

Browse files
Resolved Github actions Slack Job failure
- This commit fixes the issue in the GitHub Actions workflow where the "Slack Notify on Star" job was failing. The problem was related to the Slack.yaml configuration, which has been updated to ensure the job runs successfully. Fixes layer5io#11 Signed-off-by: Akhilender <[email protected]>
1 parent 1027491 commit e9cdead

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/slack.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
name: Slack Notify on Star
2-
on: watch
1+
name: Slack Notify
2+
on:
3+
watch:
4+
types: [started]
35
jobs:
46
star-notify:
7+
if: github.event_name == 'watch'
58
name: Notify Slack on star
6-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-22.04
710
steps:
811
- name: Get current star count
912
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')
13+
echo "STARS=$(curl --silent 'https://api.github.com/repos/${{github.repository}}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
1114
- name: Notify slack
1215
env:
1316
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
1417
uses: pullreminders/slack-action@master
1518
with:
16-
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"Someone just starred <new-repo>! (https://github.com/layer5io/preview-layer5/stargazers) Total ⭐️: ${{env.STARS}}\"}'
19+
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{github.repository}}! (https://github.com/${{github.repository}}/stargazers) Total ⭐️: ${{env.STARS}}\"}'
20+
good-first-issue-notify:
21+
if: github.event_name == 'issues' && github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only'
22+
name: Notify Slack for new good-first-issue
23+
runs-on: ubuntu-22.04
24+
steps:
25+
- name: Notify slack
26+
env:
27+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
28+
uses: pullreminders/slack-action@master
29+
with:
30+
args: '{\"channel\":\"C019426UBNY\",\"text\":\"A good first issue label was just added to ${{github.event.issue.html_url}}.\"}'

0 commit comments

Comments
 (0)