fix(ci): use Gitea file API to push CHANGELOG.md #40

Merged
sarman merged 2 commits from fix/changelog-push into master 2026-04-13 03:18:11 +00:00

2 Commits

Author SHA1 Message Date
Shaun Arman
f74238a65a fix(ci): harden CHANGELOG.md API push step per review
All checks were successful
Test / rust-fmt-check (pull_request) Successful in 26s
Test / frontend-typecheck (pull_request) Successful in 1m37s
Test / frontend-tests (pull_request) Successful in 1m25s
PR Review Automation / review (pull_request) Successful in 3m54s
Test / rust-clippy (pull_request) Successful in 4m25s
Test / rust-tests (pull_request) Successful in 5m47s
- set -euo pipefail (was -eu; pipefail catches silent pipe failures)
- Validate TAG against ^v[0-9]+\.[0-9]+\.[0-9]+$ before use in commit
  message and JSON payload — prevents shell injection
- Tolerate 404 on SHA fetch (new file): curl 2>/dev/null or true keeps
  CURRENT_SHA empty rather than causing jq to abort
- Use jq -n to build JSON payload — conditionally omits sha field when
  file does not exist yet; eliminates manual string escaping
- Check HTTP status of PUT; print response body and exit 1 on non-2xx
- Add Accept: application/json header to SHA fetch request
2026-04-12 22:13:25 -05:00
Shaun Arman
2da529fb75 fix(ci): use Gitea file API to push CHANGELOG.md — eliminates non-fast-forward rejection
All checks were successful
Test / rust-fmt-check (pull_request) Successful in 14s
PR Review Automation / review (pull_request) Successful in 2m57s
Test / frontend-typecheck (pull_request) Successful in 1m15s
Test / frontend-tests (pull_request) Successful in 1m18s
Test / rust-clippy (pull_request) Successful in 5m34s
Test / rust-tests (pull_request) Successful in 6m52s
git push origin HEAD:master fails when master advances between the job's
fetch and its push. Replace with PUT /repos/.../contents/CHANGELOG.md
which atomically updates the file on master regardless of HEAD position.
2026-04-12 22:06:21 -05:00