Commit Graph
17 Commits
Author SHA1 Message Date
bircni 2a172c8947 chore(deps): Update to Gitea 1.27.2 (#508)
<!-- cloudflare-preview --> Preview: https://pr-508.docs-gitea-com.pages.dev

Reviewed-on: https://gitea.com/gitea/docs/pulls/508
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: bircni <[email protected]>
2026-08-13 22:18:25 +00:00
Lunny Xiao bc795ac24a Fix the swagger update cron job (#481)
The scheduled `update swagger files` job has failed on **every** run since it was added (I checked the run list on gitea.com, ~250 consecutive failures). Two reasons:

1. Upstream moved the file: `go-gitea/gitea` main no longer has `templates/swagger/v1_json.tmpl`, it is now `templates/swagger/v1-swagger.generated.json`, and the placeholders changed from `{{.SwaggerAppVer}}` / `{{.SwaggerAppSubUrl}}` to `0.0.0+GITEA-API-APP-VERSION` / `/GITEA-API-APP-SUBURL/api/v1`. Because the script used `curl --silent` without `--fail`, the 404 body was written into `static/swagger-latest.json`.
2. `main` is protected (`required_approvals=1`), so the job's `git push` to main could never succeed.

Changes:

- `update_api_docs.sh`: `set -euo pipefail`, download with `--fail` (a broken download now aborts instead of committing garbage), try the new generated json first and fall back to the old template for released tags, handle the 1.28+/1.24+/<1.24 placeholder variants, and add a `--latest-only` flag.
- `Makefile`: new `update-api-docs-latest` target for the cron job; `clean` no longer deletes the committed `static/swagger-*.json` files (deleting them breaks `make build`).
- `.gitea/workflows/update_swagger.yaml`: every 12h (plus `workflow_dispatch`) it regenerates only `static/swagger-latest.json`, verifies no placeholder is left and the file is valid JSON, force pushes to `bot/update-swagger-latest` and opens a pull request via the API (HTTP 409 = a PR is already open, it just now points at the new commit). It skips entirely when the bot branch already carries the same file, so no PR churn.
- `README.md`: document the two make targets and the automation.

`secrets.DEPLOY_TOKEN` must belong to a real user with `write:repository` so the PR checks are triggered; the job fails with a clear message if it is empty.

Tested locally in a scratch clone: `make update-api-docs-latest` produces a valid `dev` spec with no placeholders left, `make update-api-docs` still regenerates all released versions, and the workflow shell logic was simulated against a local bare repo for all three paths (open PR / bot branch already up to date / main already up to date), including a shallow clone to confirm `fetch-depth: 1` force pushes work.

Fixes #454

Reviewed-on: https://gitea.com/gitea/docs/pulls/481
Reviewed-by: techknowlogick <[email protected]>
2026-08-02 23:25:17 +00:00
Lunny Xiao a7e2060a6a 1.27.1 (#476)
1.27.1 (gitea/docs#476)

Co-authored-by: Lunny Xiao <[email protected]>
2026-07-28 17:27:12 +00:00
Lunny Xiao 02f6e1753a update version 1.27.0 (#464)
Reviewed-on: https://gitea.com/gitea/docs/pulls/464
Reviewed-by: Nicolas <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2026-07-14 20:06:28 +00:00
Lunny Xiao 1033f033bc Add 1.27 rc0 documentation (#453)
Reviewed-on: https://gitea.com/gitea/docs/pulls/453
Reviewed-by: Zettat123 <[email protected]>
2026-07-01 17:14:52 +00:00
Nicolas f455b38c06 update 1.26.4 (#443)
Reviewed-on: https://gitea.com/gitea/docs/pulls/443
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Nicolas <[email protected]>
Co-committed-by: Nicolas <[email protected]>
2026-06-21 22:28:28 +00:00
Lunny Xiao c677b5da29 update 1.26.3 (#442)
Reviewed-on: https://gitea.com/gitea/docs/pulls/442
Reviewed-by: Nicolas <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2026-06-21 07:50:31 +00:00
Lunny Xiao 21aad7f5d1 update 1.26.2 (#424)
Reviewed-on: https://gitea.com/gitea/docs/pulls/424
Reviewed-by: Nicolas <[email protected]>
2026-05-20 21:59:25 +00:00
Lunny Xiao 49a6f7649a update 1.26.1 2026-04-25 11:28:59 -07:00
Lunny Xiao b5e28002f4 release 1.26.0 (#384)
Reviewed-on: https://gitea.com/gitea/docs/pulls/384
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2026-04-19 00:46:51 +00:00
Lunny Xiaoandsilverwind a7ab7af00f Add v1.26 documentation (#376)
Co-authored-by: silverwind <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/376
Reviewed-by: silverwind <[email protected]>
2026-04-09 19:27:32 +00:00
Lunny Xiao 162127170b upgrade to 1.25.5 2026-03-16 17:06:04 -07:00
Lunny Xiao feca0d2d17 Update to 1.25.4 2026-01-22 12:18:11 -08:00
Lunny Xiao 0b31573d47 upgrade 1.25.2 -> 1.25.3 2025-12-18 11:09:05 -08:00
Lunny Xiao d4181abf75 Upgrade to 1.25.2 (#306)
Reviewed-on: https://gitea.com/gitea/docs/pulls/306
2025-11-23 19:23:37 +00:00
Lunny Xiao cd0347dc76 make update_api_docs.sh work for macOS 2025-11-23 10:53:03 -08:00
TheFox0x7andLunny Xiao e3cc4ec689 update api docs (#297)
script is now standalone instead of being CI only.
Added a post 1.25 rule for templates since the variables in template changed after https://gitea.com/gitea/gitea-mirror/commit/3533263ced8
Fixes: https://github.com/go-gitea/gitea/issues/35964

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/297
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: TheFox0x7 <[email protected]>
Co-committed-by: TheFox0x7 <[email protected]>
2025-11-23 18:43:58 +00:00