Skip to content

Sync releases

Sync releases #10

Workflow file for this run

# Backfill or create GitHub Releases for existing v* tags that do not yet have a release.
name: Sync releases
on:
workflow_dispatch:
schedule:
- cron: '0 7 * * 1'
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Create missing releases for v* tags
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
for tag in $(git tag -l 'v*' | sort -V); do
if gh release view "$tag" --repo "${{ github.repository }}" >/dev/null 2>&1; then
echo "Release exists: $tag"
else
echo "Creating release for $tag"
gh release create "$tag" \
--repo "${{ github.repository }}" \
--title "Release $tag" \
--notes "Automated backfill. See [CHANGELOG](https://github.com/${{ github.repository }}/blob/main/docs/CHANGELOG.md)." || true
fi
done