Skip to content

Commit 2032926

Browse files
authored
Update slack.yml
Signed-off-by: Rian the rizzler <[email protected]>
1 parent a36f54a commit 2032926

File tree

1 file changed

+3
-43
lines changed

1 file changed

+3
-43
lines changed

.github/workflows/slack.yml

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,25 @@ jobs:
1111
if: github.event_name == 'watch'
1212
name: Notify Slack on star
1313
runs-on: ubuntu-latest
14-
env:
15-
SLACK_CHANNEL_STARS: "CSK7N9TGX" # Define your star notification channel ID here
1614
steps:
1715
- name: Get current star count
1816
run: |
19-
# Fetches the current number of stars for the repository
20-
# GITHUB_TOKEN is implicitly available to access public repo data;
21-
# for private repos, you might need to explicitly pass a token with read access.
22-
REPO_INFO_URL="https://api.github.com/repos/${{ github.repository }}"
23-
STARS_COUNT=$(curl --silent -H "Accept: application/vnd.github.v3+json" "${REPO_INFO_URL}" | jq '.stargazers_count')
24-
echo "STARS=${STARS_COUNT}" >> $GITHUB_ENV
25-
shell: bash
26-
17+
echo "STARS=$(curl --silent 'https://api.github.com/repos/${{ github.repository }}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV
2718
- name: Notify Slack
2819
env:
2920
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
3021
uses: pullreminders/slack-action@master
3122
with:
32-
args: |
33-
{
34-
"channel": "${{ env.SLACK_CHANNEL_STARS }}",
35-
"text": "${{ github.actor }} just starred ${{ github.repository }}! (<https://github.com/${{ github.repository }}/stargazers|See stargazers>) Total ⭐️: ${{ env.STARS }}"
36-
}
23+
args: '{\"channel\":\"CSK7N9TGX\",\"text\":\"${{ github.actor }} just starred ${{ github.repository }}! (https://github.com/${{ github.repository }}/stargazers) Total ⭐️: ${{ env.STARS }}\"}'
3724

3825
good-first-issue-notify:
39-
# Condition: Runs if the event is 'issues' AND the label added is 'good first issue' OR 'first-timers-only'
4026
if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only')
4127
name: Notify Slack for new good-first-issue
4228
runs-on: ubuntu-latest
43-
env:
44-
SLACK_CHANNEL_ISSUES: "C019426UBNY" # Define your 'good first issue' channel ID here
4529
steps:
4630
- name: Notify Slack
4731
env:
4832
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
4933
uses: pullreminders/slack-action@master
5034
with:
51-
# This uses Slack's Block Kit for a richer message.
52-
# 'pullreminders/slack-action' passes these args directly to Slack's chat.postMessage API.
53-
args: |
54-
{
55-
"channel": "${{ env.SLACK_CHANNEL_ISSUES }}",
56-
"blocks": [
57-
{
58-
"type": "section",
59-
"text": {
60-
"type": "mrkdwn",
61-
"text": ":new: New `good first issue` in *${{ github.repository }}*:\n<${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>"
62-
}
63-
},
64-
{
65-
"type": "context",
66-
"elements": [
67-
{
68-
"type": "mrkdwn",
69-
"text": "Labels: `${{ join(github.event.issue.labels.*.name, '`, `') }}`"
70-
}
71-
]
72-
}
73-
],
74-
"text": ":new: New good first issue in ${{ github.repository }}: ${{ github.event.issue.title }} - ${{ github.event.issue.html_url }}"
75-
}
35+
args: '{\"channel\":\"C019426UBNY\",\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\":new: Good first issue up for grabs: <${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>\"}}'

0 commit comments

Comments
 (0)