ci: use DEPLOY_TOKEN secret (GITEA_ prefix is reserved)
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:
@@ -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`
|
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
|
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.
|
||||||
@@ -55,5 +55,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_URL: https://gitea.devegamoreno.com
|
GITEA_URL: https://gitea.devegamoreno.com
|
||||||
GITEA_OWNER: jdevega
|
GITEA_OWNER: jdevega
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
run: ./scripts/publish.sh
|
run: ./scripts/publish.sh
|
||||||
@@ -12,7 +12,7 @@ help:
|
|||||||
@echo " lint Run regal lint (requires regal on PATH)"
|
@echo " lint Run regal lint (requires regal on PATH)"
|
||||||
@echo " test Run opa test for every rule and gate"
|
@echo " test Run opa test for every rule and gate"
|
||||||
@echo " build Build OPA bundles into dist/"
|
@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 " changeset Create a changeset for a new version"
|
||||||
@echo " version Apply changesets to bump package versions"
|
@echo " version Apply changesets to bump package versions"
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ make publish # upload all bundles to the Gitea generic registry
|
|||||||
- `GITEA_URL` (default `https://gitea.devegamoreno.com`)
|
- `GITEA_URL` (default `https://gitea.devegamoreno.com`)
|
||||||
- `GITEA_OWNER` (default `jdevega`)
|
- `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:
|
Artifacts land at:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -147,9 +150,10 @@ generated changeset. Later run `make version` to apply them. See
|
|||||||
`.gitea/workflows/ci.yml`:
|
`.gitea/workflows/ci.yml`:
|
||||||
|
|
||||||
1. `verify` — `npm ci`, install OPA, `scripts/check.sh`, `scripts/build.sh` (every push/PR).
|
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
|
## Evaluating a bundle
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -49,8 +49,9 @@
|
|||||||
|
|
||||||
## Integration points
|
## Integration points
|
||||||
|
|
||||||
- **Gitea Actions** reads `secrets.GITEA_TOKEN` (scope `write:package`) and
|
- **Gitea Actions** reads the `DEPLOY_TOKEN` secret (scope `write:package`) and
|
||||||
`GITEA_OWNER`/`GITEA_URL`; publish job runs only on `main`.
|
`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
|
- **`scripts/publish.sh`** uploads via `curl` to the generic registry; package names are
|
||||||
prefixed `rule-*` and `gate-*`.
|
prefixed `rule-*` and `gate-*`.
|
||||||
- **Consumer contract**: bundles scope roots to `rules` so operators can supply
|
- **Consumer contract**: bundles scope roots to `rules` so operators can supply
|
||||||
|
|||||||
Reference in New Issue
Block a user