GitHub Actions Workflow Generator Prompt
Generate a minimal GitHub Actions workflow from verified repository commands, events, runner needs, permissions, secrets, caching, and deployment constraints.
Prompt Template
You are a senior CI engineer generating the smallest maintainable GitHub Actions workflow from verified repository facts. Use the current GitHub Actions syntax and dated official documentation supplied by the user or available to you. Inspect or request the actual package, lockfile, runtime, build, lint, type-check, test, artifact, and deployment commands before writing YAML. Treat event triggers, fork behavior, permissions, secrets, environments, runners, services, matrices, caching, artifacts, concurrency, timeouts, shell quoting, reusable workflows, and deployments as separate security and compatibility decisions. Never invent commands, paths, secrets, environment names, action references, action versions, checks, passing output, or deployment authority. Prefer pinned immutable action references where the user's policy requires them, with maintainable version comments, and give every job only the permissions it needs. Repository purpose and sanitized tree: [details] Default branch and protected-branch policy: [details] Language, runtime, package manager, lockfile, and exact versions: [details] Verified install, format, lint, type-check, test, build, and artifact commands: [paste] Desired events and branch or path filters: [pull_request, push, workflow_dispatch, schedule, release, other] Forked-pull-request and untrusted-code boundary: [details] Runner operating system, architecture, shell, services, and resource needs: [details] Matrix versions and supported combinations: [verified list or none] Cache inputs and invalidation files: [details or none] Artifacts, retention, reports, and failure behavior: [details or none] Required secrets, variables, OIDC, environments, approvals, and permissions: [names only, never values] Concurrency, cancellation, timeout, retry, and cost limits: [details] Deployment target and explicit authorization boundary: [details or no deployment] Existing workflows, current action references, and exact errors: [paste or none] Validation available: [local commands, actionlint, YAML parser, test branch, required checks] Provide: 1. A verified-input and assumptions table. 2. A trigger and trust-boundary decision, including fork and secret behavior. 3. One complete minimal workflow file using only verified commands, paths, action references, and supported syntax. 4. A job dependency map and least-privilege permissions table. 5. Cache, matrix, service, artifact, environment, and concurrency choices with reasons, omitting anything unnecessary. 6. Secret-safe setup steps using names and placeholders only. 7. Validation steps for YAML, action references, shell commands, permissions, forks, cache behavior, required checks, and a test branch. 8. Rollback instructions and a final audit for untrusted-code execution, secret exposure, mutable dependencies, excessive permissions, duplicate runs, stale caches, missing timeouts, and unauthorized deployment. Do not enable deployment, write secrets, weaken branch protection, or claim a green run without verified output.
Example Output
Workflow Decision
Run install, lint, type-check, test, and build on pull requests to [default branch] and pushes to that branch. Use the verified Linux runner and runtime version from the repository, dependency caching keyed by the supplied lockfile, read-only repository contents, a job timeout, and concurrency that cancels superseded runs on the same pull request. Do not expose secrets or run deployment for forked code.
Minimal Job Shape
name: CI
on:
pull_request:
branches: ['[default branch]']
push:
branches: ['[default branch]']
permissions:
contents: read
jobs:
verify:
runs-on: [verified runner]
timeout-minutes: [limit]
steps:
- uses: [verified checkout reference]
- uses: [verified runtime setup reference]
- run: [verified install command]
- run: [verified lint command]
- run: [verified test command]
- run: [verified build command]
Validate the YAML and action references, then open a test pull request and confirm required checks, fork behavior, cache misses and hits, and cancellation before merging.
Tips for Best Results
- ๐กPaste the repository's real scripts and lockfile details so the workflow does not invent commands that only look conventional.
- ๐กDefine fork, secret, and deployment boundaries before choosing pull_request, pull_request_target, push, or environment triggers.
- ๐กStart with one least-privilege verification job; add matrices, services, caches, artifacts, and deployments only when evidence requires them.
Frequently Asked Questions
What is the GitHub Actions Workflow Generator Prompt prompt?
Generate a minimal GitHub Actions workflow from verified repository commands, events, runner needs, permissions, secrets, caching, and deployment constraints. It's a free ChatGPT prompt template from our Coding collection โ copy it, fill in the bracketed variables, and paste it into your AI tool.
Which AI tools work with this prompt?
It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.
How do I customize this ChatGPT prompt?
Replace the bracketed variables โ such as [details], [paste], [verified list or none] โ with your own details before running it. Paste the repository's real scripts and lockfile details so the workflow does not invent commands that only look conventional.
Is this prompt free to use?
Yes. Every prompt on PromptAtlas is free to copy, customize, and use โ no signup required.
Related Prompts
Code Review Assistant
Get a thorough, senior-level code review with actionable feedback on quality, security, performance, and best practices.
Debugging Detective
Systematically debug errors and unexpected behavior with root cause analysis and fix suggestions.
Code Refactoring Advisor
Transform messy, complex code into clean, maintainable, well-structured code with clear explanations.