forked from IntersectMBO/cardano-node
-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (29 loc) · 1.17 KB
/
trigger-release.yaml
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
name: Check for New Release
on:
schedule:
- cron: '*/10 * * * *' # Schedule to run every 24 hours
jobs:
check-for-release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: check for new release
run: |
upstreamTag=$(curl -s "https://api.github.com/repos/IntersectMBO/cardano-node/releases/latest" | jq -r '.tag_name')
forkedTag=$(curl -s "https://api.github.com/repos/Emurgo/cardano-node/releases/latest" | jq -r '.tag_name')
echo "Upstream Tag: $upstreamTag"
echo "Forked Tag: $forkedTag"
if [ "$upstreamTag" != "$forkedTag" ]; then
echo "New release detected. Triggering release workflow."
curl -X POST \
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/emurgo/cardano-node/dispatches \
--data '{"event_type": "trigger-release"}'
else
echo "No new release detected."
fi