GitHub Actions Builder
工作流参数 按技术栈自动匹配官方 Action
运行与安全 并发、超时与代码扫描
CodeQL 对 Node.js、Python、Go、Java 生效;Go/Java 会自动 autobuild,PHP 会跳过并给出提醒。扫描作业只读代码,单独申请 security-events 权限。
语法与安全自检 生成后逐项核对
工作流预览 保存到 .github/workflows/
表达式里的 ${{ }} 会原样保留,粘贴到仓库后由 GitHub 求值。
How to Use
📖 What it does
GitHub Actions syntax is not complicated. The hard part is keeping a pipeline maintainable: checkout, set up the runtime, restore caches, run tests, upload artifacts and publish an image, each in the right order. Matrix versions, permissions and triggers interact, and the failures that hurt are not only indentation errors. They are secrets with too much scope, cache keys that never match, and image jobs that run on every pull request.
This generator builds one readable CI pipeline for the selected stack. Node.js uses `setup-node` with npm, yarn or pnpm cache. Python uses `setup-python` with pip, Poetry or uv. Go uses `setup-go` and `go.sum`. Java uses `setup-java` plus Maven or Gradle cache. PHP uses `shivammathur/setup-php` and Composer. When image publishing is enabled, a separate `docker` job gets `packages: write` and runs only on a push to the default branch.
Everything is assembled in the browser. The tool never calls the GitHub API and never reads a repository. The output is a starting structure, not proof that the workflow will pass. Real runtime, cache hits and runner image differences only appear in the Actions log.
✨ Features
- Five stacks: Node.js, Python, Go, Java and PHP, each mapped to the official setup action and common package managers.
- Version matrices and dependency caches for npm, pnpm, pip, poetry, uv, Maven and Gradle.
- Least privilege and concurrency control: `contents: read` by default, with optional cancel-in-progress per branch.
- Build artifacts through `upload-artifact`, including retention days and fail-on-missing-file.
- Image publishing through Buildx to GHCR, Docker Hub or a custom registry, with matched login secrets and a commit-SHA tag.
- CodeQL scanning for Node.js, Python, Go and Java, with a dedicated `security-events: write` permission.
🚀 How to use it
- Enter a workflow name, choose the stack and package manager; switching stacks applies matching install, test, build and artifact defaults.
- Edit the version matrix and trigger branches, keeping push, pull_request and manual runs that the repository needs.
- In the runtime and security card, set the job timeout and artifact retention, then decide on concurrency and CodeQL.
- Replace install, test and build commands with the repository scripts, and fill the artifact path or image name only when needed.
- Save the YAML under `.github/workflows/ci.yml`, run it on a test branch, then inspect cache keys, permissions and scan results.
⚠️ Before you rely on it
- Pin action versions: `actions/checkout@v4` is safer than `@main`; high-supply-chain repositories should pin full commit SHAs.
- Never use pull_request_target: it runs fork code with access to secrets; this generator does not emit that trigger.
- Caches need a stable key: `setup-node` with `cache: npm` hashes the lockfile, so a missing lockfile causes repeated misses.
- Do not push images from pull requests: fork PRs usually lack Packages write access; the image job runs only on pushes to the first branch.
- Keep secrets out of logs: never `echo ${{ secrets.X }}`; use `::add-mask::` or print only a length when debugging.
- CodeQL needs `security-events: write`; fork PRs are skipped by the `if` guard, so run a scan on a same-repository branch before merging.