-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (38 loc) · 1.32 KB
/
notify.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
name: Act on release
on:
workflow_call:
inputs:
release_tag:
type: string
description: 'The tag of the release'
required: true
workflow_dispatch:
inputs:
release_tag:
type: string
description: 'The tag of the release'
required: true
jobs:
push_notification:
name: Push Notification
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # The python version to use.
cache: 'pip'
cache-dependency-path: 'push-notify/requirements.txt'
- name: Install dependencies
run: pip install -r push-notify/requirements.txt
- name: Create google-auth json
run: echo "${{ secrets.GOOGLE_AUTH_JSON }}" | base64 -d > google-services.json
- name: Run push notification script
run: |
release_tag=${{ github.event.inputs.release_tag }}
release_body=$(gh release view $release_tag --json body -q .body)
python3 push-notify --title "App update $release_tag" --body "$release_body" --api_url ${{ secrets.NOTIF_API_URL }} --bearer ${{ secrets.NOTIF_API_BEARER }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}