diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 46e292b..f684d45 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -35,6 +35,20 @@ jobs: config-file: release-please-config.json manifest-file: .release-please-manifest.json + # GitHub marks the newest release "Latest", so a builder release would take the badge from the core package. + # Give it back to the newest core release (tags v); a core release in the same run is that release. + - name: Keep the core release as Latest + if: steps.release.outputs['src--release_created'] == 'true' + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + tag=$(gh release list --exclude-drafts --exclude-pre-releases --limit 100 --json tagName \ + --jq '[.[] | select(.tagName | test("^v[0-9]"))][0].tagName') + if [ -n "$tag" ]; then + gh release edit "$tag" --latest + fi + publish: if: needs.release-please.outputs.release_created == 'true' needs: release-please