Skip to main content
The Shrike Action is a thin wrapper around the CLI. mode: delta reports newly dead code without changing files; mode: prune produces a verified cleanup PR.

Generate a workflow

Expected: created .github/workflows/shrike.yml with an advisory delta workflow. The default is fail-on: never and permissions: contents: read. Nothing is committed, pushed, or analyzed by the installer.
The installer is conservative:
  • It refuses absolute paths, .., paths outside .github/workflows/, and symlinks that escape the repository.
  • An identical workflow is unchanged. A different file is skipped with exit 2 unless you pass --force.
  • It never edits another workflow file, including .github/workflows/ci.yml.
  • It never runs analysis, project scripts, or network requests, and never uses secrets.
The generated workflow references getshrike/shrike/packages/action@v1. The Action resolves a project-local getshrike install (or SHRIKE_CLI). Keep getshrike in the project’s devDependencies, or add an install step before the Action, so the workflow can run.
The advisory workflow:
With --gate, the generated workflow sets fail-on: newly-dead and permissions become:

Action inputs and outputs

Delta mode

Delta mode is read-only. It runs the CLI’s delta command with --json --allow-dirty --fail-on never, writes .shrike/action-delta.json, and posts a step summary. It exits 1 when max-items is exceeded or when fail-on: newly-dead finds anything. It never opens a PR or changes source files.
Grant only contents: read for delta mode. The advisory default writes a step summary and artifact, not a PR comment.

Prune mode

Prune mode runs shrike prune --base <base> --json --pr, opens a draft PR with gh, and writes receipts. It refuses fork pull requests with exit 2 because the write token is not trusted; a missing or unreadable event file on a PR also fails closed.
Prune mode writes commits and opens a pull request. Grant only contents: write and pull-requests: write. The Action does not need actions: write.
The Action supplies the GitHub Actions bot git identity when the runner has none, so prune can commit its verified batch. See Verified pruning for verification and receipts.

Fork pull requests

  • Delta mode is read-only and safe to run with the default read token on fork PRs.
  • Prune mode refuses fork PRs rather than using an untrusted write token. Run cleanup from a branch in the main repository, or have a maintainer run it locally.
Do not switch to pull_request_target to work around this: it gives a workflow write access in the context of the base repository, which is unsafe for untrusted PR content.

Next