ci: use DEPLOY_TOKEN secret (GITEA_ prefix is reserved)
ci / verify (push) Successful in 4m3s
ci / publish (push) Failing after 47s

Gitea forbids secret names starting with GITEA_; map the DEPLOY_TOKEN
secret to the GITEA_TOKEN env var consumed by publish.sh.
This commit is contained in:
jdevega
2026-09-15 20:34:56 +02:00
parent cc8e9a23b3
commit 953523e40a
5 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -35,4 +35,5 @@ Bundles are built from `package.json#version`, so the registry upload uses the n
CI verifies (format, lint, schema check, tests) and builds bundles on every push/PR. On `main`
the `publish` job uploads the bundles to the Gitea generic package registry using the
`GITEA_TOKEN` repository secret (requires `write:package` scope).
`DEPLOY_TOKEN` repository secret (requires `write:package` scope). Secret names cannot start
with the reserved `GITEA_` prefix.
+1 -1
View File
@@ -55,5 +55,5 @@ jobs:
env:
GITEA_URL: https://gitea.devegamoreno.com
GITEA_OWNER: jdevega
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: ./scripts/publish.sh
+1 -1
View File
@@ -12,7 +12,7 @@ help:
@echo " lint Run regal lint (requires regal on PATH)"
@echo " test Run opa test for every rule and gate"
@echo " build Build OPA bundles into dist/"
@echo " publish Publish bundles to Gitea generic registry (needs GITEA_TOKEN)"
@echo " publish Publish bundles to Gitea generic registry (needs GITEA_TOKEN env)"
@echo " changeset Create a changeset for a new version"
@echo " version Apply changesets to bump package versions"
+6 -2
View File
@@ -127,6 +127,9 @@ make publish # upload all bundles to the Gitea generic registry
- `GITEA_URL` (default `https://gitea.devegamoreno.com`)
- `GITEA_OWNER` (default `jdevega`)
In CI, set a secret named `DEPLOY_TOKEN` on the repository — the secret name must not start with
the reserved `GITEA_` prefix — and `publish.sh` exposes it to the job as `GITEA_TOKEN`.
Artifacts land at:
```
@@ -147,9 +150,10 @@ generated changeset. Later run `make version` to apply them. See
`.gitea/workflows/ci.yml`:
1. `verify``npm ci`, install OPA, `scripts/check.sh`, `scripts/build.sh` (every push/PR).
2. `publish` — on `main` only, rebuilds and uploads bundles with `GITEA_TOKEN`.
2. `publish` — on `main` only, rebuilds and uploads bundles with the `DEPLOY_TOKEN` secret.
Create the `GITEA_TOKEN` repository secret on Gitea with at least `write:package` scope.
Create the `DEPLOY_TOKEN` repository secret on Gitea with at least `write:package` scope
(secret names cannot start with `GITEA_`).
## Evaluating a bundle
+3 -2
View File
@@ -49,8 +49,9 @@
## Integration points
- **Gitea Actions** reads `secrets.GITEA_TOKEN` (scope `write:package`) and
`GITEA_OWNER`/`GITEA_URL`; publish job runs only on `main`.
- **Gitea Actions** reads the `DEPLOY_TOKEN` secret (scope `write:package`) and
`GITEA_OWNER`/`GITEA_URL`; publish job runs only on `main`. Secret names must not start with
the reserved `GITEA_` prefix.
- **`scripts/publish.sh`** uploads via `curl` to the generic registry; package names are
prefixed `rule-*` and `gate-*`.
- **Consumer contract**: bundles scope roots to `rules` so operators can supply