Check for New Release #2100
This file contains 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: Check for New Release | |
on: | |
schedule: | |
- cron: '30 0 * * *' # Schedule to run at 00:30 after the sync fork at 00:00 | |
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" | jq -r '.[0].tag_name') | |
forkedTag=$(curl -s "https://api.github.com/repos/Emurgo/cardano-node/releases" | jq -r '.[0].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 |