From b90f07a816ef0aad2329e6877c0a289d4dde56fc Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Sun, 19 Jul 2026 22:48:30 +0200 Subject: [PATCH] ci(release): push tag to Codeberg before creating the release The Codeberg publish step (added but not yet exercised by a release) would 500 the same way agendula's did: the tag is created via the Gitea API, which the push mirror doesn't propagate promptly, so a release POST with target_commitish outruns the mirror and fails on an unknown commit. Push the tag straight to Codeberg from the runner, then create the release against that existing tag with no target_commitish. Race-free. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/release.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index e9a480a..b1895af 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -392,11 +392,20 @@ jobs: sed -i -e '/./,$!d' release-notes.md fi [ -s release-notes.md ] || echo "_See CHANGELOG.md for ${VERSION}._" > release-notes.md - python3 - "$TAG" "$SHA" <<'PY' > cb-payload.json + # The pipeline creates the tag via the Gitea API, which the push mirror + # (sync_on_commit only fires on real git pushes) doesn't propagate + # promptly — so a release POST that carries a target_commitish can + # outrun the mirror and 500 on a commit/tag Codeberg hasn't received. + # Push the tag straight to Codeberg so it's guaranteed present, then + # attach the release to that existing tag with NO target_commitish + # (which is what triggered the 500). + git tag -f "$TAG" "$SHA" + git push -f "https://jlmakiola:${TOKEN}@codeberg.org/jlmakiola/calendula.git" \ + "refs/tags/$TAG" + python3 - "$TAG" <<'PY' > cb-payload.json import json, sys print(json.dumps({ "tag_name": sys.argv[1], - "target_commitish": sys.argv[2], "name": sys.argv[1], "body": open("release-notes.md").read(), "draft": False,