Sync releases #10
This file contains hidden or 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
| # 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 |