feat: add Forgejo Actions CI workflow #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "forgejo-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?
Port the GitHub Actions CI workflow to Forgejo Actions. Key changes:
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
CI Security Review
Critical / High
None found.
Medium
.forgejo/workflows/publish.yml: Missing explicit permissions declaration.forgejo/workflows/publish.yml(workflow level, between lines 3-9)permissions:block at the workflow level. Depending on Forgejo server configuration, the default GITHUB_TOKEN may have broader permissions than needed (e.g.,contents: write,packages: write). The jobs only needcontents: read.pushtomain, so only already-reviewed code runs here.permissions: contents: readat the workflow level (matching the GitHub variant which has it at job level)..github/workflows/auto-response.yml:8-9: Workflow-level permissions instead of job-level.github/workflows/auto-response.yml, lines 8-9issues: writeandcontents: readare set at the workflow level. Currently there is only one job, so this is functionally equivalent to job-level. However, if a second job is added later, it will inheritissues: writeunnecessarily.permissions:block into theautomovejob definition.Low
.forgejo/workflows/ci.yml:39-41: Direct expression interpolation of SHAs inrun:block.forgejo/workflows/ci.yml, lines 39-41BASE_SHA=${{ github.event.pull_request.base.sha }}andHEAD_SHA=${{ github.event.pull_request.head.sha }}env:rather than direct interpolation, to avoid establishing a pattern that could be copied for attacker-controlled fields.Positive Security Observations
.forgejo/prompts/review.md,adversarial.md,ci-security.md) and all inline prompts in.github/workflows/ci.ymlinclude security preambles instructing the model to treat PR content as untrusted and ignore embedded instructions.Read,Glob,Grep,Bash(git diff:*),Bash(git log:*),Bash(tee /tmp/review-body.md:*),Bash(touch /tmp/review-failed)(Forgejo) orRead,Glob,Grep,Bash(gh pr review:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(touch /tmp/review-failed)(GitHub). No broadBash(*)orBash(curl:*)access.dorny/paths-filter@fbd0ab8...) or tag pins from trusted publishers (actions/*,anthropics/*,denoland/*,systeminit/*). The Forgejo Claude binary download uses SHA256 checksum verification.contents: read) with job-level overrides only where needed.pull_request_targetusage. Theissues: [opened]trigger inauto-response.ymlproperly handles attacker-controlled content viaJSON.stringify(no string interpolation injection) and validates the external API response before constructing URLs.issue.title,issue.body,pull_request.body, etc.). The Forgejo variant reads prompts from repo files; the GitHub variant uses inline YAML strings with only safe expressions (github.repository,github.event.pull_request.number).ANTHROPIC_API_KEYto Claude steps,BOT_TOKEN/SWAMP_API_KEYto their respective steps).workflow_dispatchinput validation: Theregenerate-modelsworkflow usestype: choicewith a fixed option set, preventing arbitrary input injection.Verdict
PASS — No critical or high severity findings. The workflow security posture is strong, with well-scoped permissions, hardened LLM prompts, pinned dependencies, and proper handling of untrusted input. Two medium findings are best-practice improvements that don't represent exploitable vulnerabilities.
Code Review
Blocking Issues
Command injection in cve/dirtyfrag/extensions/models/dirtyfrag_detect.ts:176
checkConnectivity() interpolates the user-supplied host string directly into a bash -c
command string. host originates from GlobalArgsSchema.targetHost (a plain string field).
The only pre-check filters localhost/127.0.0.1/::1. Any value containing shell
metacharacters executes on the local machine. port is typed as number so it is safe.
Fix: replace the bash invocation with Deno.connect wrapped in a try/catch so that TCP
reachability is tested without spawning a shell at all.
Overly broad catch blocks in codegen/commands/generate.ts:326 and :631
Both blocks silently swallow every error including permission-denied and disk-full,
which should abort generation. The code following each block calls Deno.remove on
orphaned model files, so a masked write-permission error could silently skip pruning
and leave stale generated files in the output tree.
Fix: re-throw unless the error is Deno.errors.NotFound. The correct pattern is already
used in codegen/scripts/bump-versions.ts -- apply it to both catch sites in generate.ts.
Suggestions
codegen/aws/enrichments/parser.ts:11 and codegen/gcp/enrichments/parser.ts:11 --
unhandled Deno.readTextFile failure. Wrap in try/catch and re-throw with the source
file path appended so codegen failures are easier to diagnose.
datastore/gcs/extensions/datastores/_lib/gcs_client.ts -- bodyPreview included in
401/403 error messages. GCS auth-failure bodies rarely contain credentials, but
omitting the preview from those paths is a cheap defence-in-depth improvement.