Skip to content

Commit

Permalink
Create trigger-release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
NanuIjaz authored Jan 25, 2024
1 parent 4e404e3 commit a4c2edb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/trigger-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check for New Release

on:
schedule:
- cron: '0 */24 * * *' # 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=$(git describe --tags --abbrev=0)
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

0 comments on commit a4c2edb

Please sign in to comment.