-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathrelease-notification-on-slack.yml
More file actions
36 lines (34 loc) · 1.18 KB
/
release-notification-on-slack.yml
File metadata and controls
36 lines (34 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Slack Post
on:
workflow_dispatch: # Manual trigger
inputs:
github_ref:
description: 'Manually provided value for GITHUB_RELEASE_TAG of a release'
required: true
type: string
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
release:
types: [published]
jobs:
build:
name: Slack Post
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
export GITHUB_RELEASE_TAG=${{ inputs.github_ref }}
else # release event
export GITHUB_RELEASE_TAG=$(basename ${GITHUB_REF})
fi
echo "New release published ${GITHUB_RELEASE_TAG}"
pip3 install httpx PyGithub
echo $PWD
ls -lah
python ./.github/scripts/announce_release_on_slack.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_TOKEN: ${{ secrets.RUPY_TRACER_RELEASES_TOKEN }}
SLACK_SERVICE: ${{ secrets.RUPY_TRACER_RELEASES_SERVICE_ID }}
SLACK_TEAM: ${{ secrets.RUPY_TOWN_CRIER_TEAM_ID }}