ci: rework workflow for Gitea Actions (M0.2) #2
Reference in New Issue
Block a user
Delete Branch "fix/m0.2-gitea-friendly-ci"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
.gitea/workflows/ci.yamlto be Gitea Actions friendly.commitlintis now a bash regex check over the PR commit range — no external action, no octokit.gitleaksruns the official binary inline (downloaded from upstream releases).test/image/e2ejobs gated on the existence of real code so empty repos pass cleanly.Why
The original workflow used
wagoid/commitlint-github-action@v6andgitleaks/gitleaks-action@v2. Both call the GitHub API and 404 on Gitea (error trying to get list of pull request's commits: not found). Without this fix, no PR can ever go green and branch protection (M0.2) cannot be turned on.Linked milestone: M0.2
How
git log --format=%s base..headpiped through a bash regex matching the Conventional Commits grammar (feat|fix|...|revert, optional scope, optional!, ≤72 char subject). Same enforcement, zero deps.curl ... | tar -xz; gitleaks detect --exit-code 1. Pins to v8.18.4.if: hashFiles('go.sum') != ''/hashFiles('package.json') != ''/hashFiles('Dockerfile') != ''. Empty repos skip those jobs; they activate the moment real code lands.Trivy is unchanged — it runs a local fs scan and never touched the GitHub API.
Test plan
Risk
Blast radius: repo-local; no services touched. Worst case: CI still fails for some other reason and we iterate again.
What could break: the bash regex is stricter than commitlint's full ruleset (no body/footer rules) — acceptable for M0.2; will revisit when we add a proper commitlint-via-npm path post-runner-tooling.
Rollback plan: revert the PR.
Checklist
The original ci.yaml used wagoid/commitlint-github-action and gitleaks/gitleaks-action, both of which hit GitHub-specific API endpoints that 404 on Gitea ("error trying to get list of pull request's commits: not found"). Changes: - commitlint: bash regex against Conventional Commits, scoped to the PR commit range. Zero external deps. - gitleaks: inline tarball download + binary run, exit-code 1 on any finding. - trivy: unchanged (works fine; uses local fs scan). - Per-stack test/image/e2e jobs now gated on hashFiles(go.sum) / hashFiles(package.json) / hashFiles(Dockerfile) so they skip cleanly on empty repos and light up automatically when real code lands (M4.1, M5.1, etc.). Refs: M0.2