Commit Graph
41 Commits
Author SHA1 Message Date
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
Renovate Bot 9f3bb6cc19 chore(deps): pin dependencies (#475)
This PR contains the following updates:

| Package | Type | Update | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|---|---|
| [actions/checkout](https://github.com/actions/checkout) | action | pinDigest |  → `3d3c42e` |  |  |
| [actions/setup-node](https://github.com/actions/setup-node) | action | pinDigest |  → `8207627` |  |  |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | action | pinDigest |  → `e6de054` |  |  |
| [pnpm/action-setup](https://github.com/pnpm/action-setup) | action | pinDigest |  → `0ebf471` |  |  |
| [react](https://react.dev/) ([source](https://github.com/react/react/tree/HEAD/packages/react)) | dependencies | patch | [`19.2.7` → `19.2.8`](https://renovatebot.com/diffs/npm/react/19.2.7/19.2.8) | ![age](https://developer.mend.io/api/mc/badges/age/npm/react/19.2.8?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react/19.2.7/19.2.8?slim=true) |
| [react-dom](https://react.dev/) ([source](https://github.com/react/react/tree/HEAD/packages/react-dom)) | dependencies | patch | [`19.2.7` → `19.2.8`](https://renovatebot.com/diffs/npm/react-dom/19.2.7/19.2.8) | ![age](https://developer.mend.io/api/mc/badges/age/npm/react-dom/19.2.8?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-dom/19.2.7/19.2.8?slim=true) |

---

### Release Notes

<details>
<summary>react/react (react)</summary>

### [`v19.2.8`](https://github.com/react/react/releases/tag/v19.2.8): 19.2.8 (July 21st, 2026)

[Compare Source](https://github.com/react/react/compare/v19.2.7...v19.2.8)

#### React Server Components

- Performance improvements when decoding
  ([#&#8203;37087](https://github.com/facebook/react/pull/37087) by [@&#8203;eps1lon](https://github.com/eps1lon))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xOTEuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE5MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://gitea.com/gitea/docs/pulls/475
Reviewed-by: silverwind <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
2026-07-27 06:14:13 +00:00
Renovate Bot c9216685d5 chore(deps): update actions/checkout action to v7 (#445)
Reviewed-on: https://gitea.com/gitea/docs/pulls/445
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2026-06-23 00:05:55 +00:00
Lunny Xiao d3d546fa3b Fix updating swagger failure caused by no content to change 2025-11-23 10:59:46 -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
Lunny Xiao 4ddfcd6aaf Remove outdated versions and keep the latest 5 versions(include the current developing version and latest 4 stable versions (#304)
Resolve #302

Reviewed-on: https://gitea.com/gitea/docs/pulls/304
Reviewed-by: delvh <[email protected]>
2025-11-22 05:36:55 +00:00
Renovate Bot 8ba2066894 chore(deps): update actions/checkout action to v6 (#303)
Reviewed-on: https://gitea.com/gitea/docs/pulls/303
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-11-21 21:30:18 +00:00
Lunny Xiao cf9b8dce28 uprade 1.24.7 2025-10-25 21:03:20 -07:00
Lunny Xiao de6d4374b0 Upgrade to 1.24.6 2025-09-11 20:20:46 -07:00
Renovate Bot 6b64b97e3b chore(deps): update actions/checkout action to v5 (#261)
Reviewed-on: https://gitea.com/gitea/docs/pulls/261
Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
2025-09-01 01:38:35 +00:00
Lunny Xiao c699d12a55 upgrade to 1.24.5 2025-08-14 18:52:32 -07:00
Lunny Xiao 03c98878cf upgrade to 1.24.4 2025-08-04 17:00:13 -07:00
Lunny Xiao 47594bba97 upgrade gitea to 1.24.3 2025-07-15 09:44:13 -07:00
Lunny Xiao 870f30e886 upgrade to 1.24.2 2025-06-21 10:13:34 -07:00
Lunny Xiao 33ec7a49df upgrade to 1.24.1 2025-06-19 15:31:41 -07:00
techknowlogick a320f53087 1.24.0 2025-06-10 15:21:23 +00:00
Lunny Xiao e1ed1a6280 Upgrade Gitea from 1.23.7 -> 1.23.8 2025-05-13 09:51:20 -07:00
Lunny Xiao 6e63ddb901 Add 1.24.0-rc0 documentation (#220)
Reviewed-on: https://gitea.com/gitea/docs/pulls/220
2025-05-05 16:47:20 +00:00
Lunny Xiao ae186bfdcc Update to 1.23.7 2025-04-07 15:41:45 -07:00
Lunny Xiao ba60733fd9 upgrade to gitea 1.23.6 2025-03-24 14:53:49 -07:00
Lunny Xiao 41bc13f04f Release of Gitea 1.23.5 (#177)
Reviewed-on: https://gitea.com/gitea/docs/pulls/177
2025-03-05 01:28:46 +00:00
Lunny Xiao bb149ae308 upgrade to 1.23.4 2025-02-19 11:05:44 -08:00
Lunny Xiao 452b13ec63 upgrade to 1.23.3 (#168)
Reviewed-on: https://gitea.com/gitea/docs/pulls/168
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2025-02-06 19:34:36 +00:00
Lunny Xiao cea3a053b7 upgrade to 1.23.2 (#166)
Reviewed-on: https://gitea.com/gitea/docs/pulls/166
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2025-02-05 21:50:46 +00:00
yp05327 192a773da3 Fix update swagger json (#150)
I can not understand the old logic:
- download the web page (not the raw data) from GitHub
- replace `AppVer`
- remove the file???

It does nothing.

The correct logic:
- download the raw file from GitHub
- replace `AppVer` and `AppSubUrl`
- move the file to the correct place

As the script is not correct for a long time, added the support for all version since 1.19.

Fix #142

Reviewed-on: https://gitea.com/gitea/docs/pulls/150
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: yp05327 <[email protected]>
Co-committed-by: yp05327 <[email protected]>
2025-01-14 03:00:44 +00:00
Lunny Xiao 1ddf6a1822 upgrade to 1.23.1 (#148)
Reviewed-on: https://gitea.com/gitea/docs/pulls/148
Co-authored-by: Lunny Xiao <[email protected]>
Co-committed-by: Lunny Xiao <[email protected]>
2025-01-10 18:58:33 +00:00
Lunny Xiao 67e83400bd update version to 1.23.0 (#141)
Reviewed-on: https://gitea.com/gitea/docs/pulls/141
2025-01-10 05:28:14 +00:00
yp05327andLunny Xiao 4183476129 Fix CI error in update swagger files (#145)
If there's no changes, the CI will end with exit 1.
<img width="689" alt="image.png" src="attachments/62248c28-6767-4b56-9e06-571e13feb867">

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/145
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: yp05327 <[email protected]>
Co-committed-by: yp05327 <[email protected]>
2025-01-09 18:48:57 +00:00
Lunny Xiao dc2b857cac Upgrade to 1.22.6 2024-12-13 00:09:11 -08:00
Lunny Xiao 869fb8d4e5 Upgrade to 1.22.5 2024-12-11 13:05:31 -08:00
Lunny Xiao 3e404a348f Upgrade to 1.22.4 (#109)
Reviewed-on: https://gitea.com/gitea/docs/pulls/109
2024-11-26 04:38:25 +00:00
Lunny Xiao d2ff4a6117 more changes 2024-10-08 23:03:32 -07:00
Lunny Xiao 610b028ba9 upgrade to 1.22.3 2024-10-08 21:39:53 -07:00
Lunny Xiao 05a0760f6b fix bug 2024-09-13 14:39:59 -07:00
Lunny Xiao 3ac151749b fix bug 2024-09-13 14:25:00 -07:00
Lunny Xiao 98633d3b32 Use deploy token rather than deploy key 2024-09-13 12:03:35 -07:00
Lunny Xiao c12effbaff Improve update swagger workflow 2024-09-13 11:46:34 -07:00
Lunny Xiao 3ed7b49467 Improve update swagger workflow 2024-09-13 11:44:39 -07:00
Lunny Xiao e67590e0e2 Fix bug 2024-09-13 10:40:37 -07:00
Lunny Xiao b0efb07c3f Fix bug when update swagger 2024-09-12 11:00:02 -07:00
Lunny Xiao e84a95f4da Update swagger files on schedule 2024-09-05 23:57:00 -07:00