Slack Notify #3090
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Slack Notify | |
on: | |
watch: | |
types: [started] | |
issues: | |
types: [labeled] | |
jobs: | |
star-notify: | |
if: github.event_name == 'watch' | |
name: Notify Slack on star | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current star count | |
run: | | |
echo "STARS=$(curl --silent 'https://api.github.com/repos/${{ github.repository }}' -H 'Accept: application/vnd.github.preview' | jq '.stargazers_count')" >> $GITHUB_ENV | |
- name: Notify Slack | |
uses: slackapi/[email protected] | |
with: | |
method: chat.postMessage | |
token: ${{ secrets.SLACK_BOT_TOKEN }} | |
payload: | | |
channel: CSK7N9TGX | |
type: "mrkdwn" | |
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 }}" | |
good-first-issue-notify: | |
if: github.event_name == 'issues' && (github.event.label.name == 'good first issue' || github.event.label.name == 'first-timers-only') | |
name: Notify Slack for new good-first-issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify Slack | |
uses: slackapi/[email protected] | |
with: | |
method: chat.postMessage | |
token: ${{ secrets.SLACK_BOT_TOKEN }} | |
payload: | | |
channel: C019426UBNY | |
text: ":new: Good first issue up for grabs: <${{ github.event.issue.html_url }}|${{ github.event.issue.title }}>" |