Skip to content

Check for New Bouncer Release #124

Check for New Bouncer Release

Check for New Bouncer Release #124

name: Check for New Bouncer Release
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
check-release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Get latest bouncer release tag
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
UPSTREAM_TAG=$(gh api /repos/hslatman/caddy-crowdsec-bouncer/releases/latest --jq .tag_name)
VERSION=${UPSTREAM_TAG#v}
echo "Latest Upstream Version: $VERSION"
# Checks repo tags for 'b{VERSION}-' (e.g., b0.10.0-)
if gh release list --json tagName --jq '.[].tagName' | grep -q -- "-b${VERSION}-"; then
echo "✅ Release containing b${VERSION}- already exists. Skipping build."
echo "trigger=false" >> $GITHUB_OUTPUT
else
echo "🚀 New Bouncer version ${VERSION} detected! Triggering build."
echo "trigger=true" >> $GITHUB_OUTPUT
fi
- name: Trigger build workflow
if: steps.check.outputs.trigger == 'true'
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: bouncer-release