
- Updated
Write a GitHub Actions workflow
This prompt writes a GitHub Actions workflow, for example to run tests, for a project in the language you name.
Write a GitHub Actions workflow for a [LANGUAGE] project. It should: [RUN TESTS / LINT / BUILD / DEPLOY] on [EVENT, e.g. pull requests to main]. Deployment target: [TARGET] Caching needed: [DEPENDENCIES] Provide the YAML with comments, explain each step, list the secrets I must add and suggest one improvement to make the pipeline faster.
Pin action versions and keep secrets in repository settings, never in the workflow file.
Get a better result
A commented workflow YAML for your project that runs your chosen jobs on the event you named, with dependency caching, a step by step explanation, the secrets you need to add and one idea to make it faster.
The prompt names the jobs, the trigger and the target, which are the three choices every workflow needs. Asking for comments and an explanation of each step means you can maintain it later. The secrets list stops the most common first run failure, a missing secret, and the speed idea is often caching, which saves minutes on every run.
Secrets are written into the YAML file.
Fix: Keep them in the repository settings and refer to them by name, as the tip says. Ask it to list each name it uses.
- The deploy job runs on every pull request. Ask for deploy to run only on pushes to main, and only after the test job passes.
- Actions are used without a version. Ask it to pin every action to a version tag or commit, as the tip says, and to explain how to update them later.
Ask for a matrix that runs the tests on two or three language versions, and how to stop the whole run when one fails.
The first run failed at this step: [PASTE LOG]. Explain the cause and give me the corrected YAML for that step.
More chat & writing prompts
See all 465 →More like this
- Map a task into an AI-assisted workflowChatGPT · Gemini · Claude
- Check your code for leaked API keys and secretsClaude · ChatGPT · Gemini
- Build a small command-line toolClaude · ChatGPT · Gemini
- Write an architecture decision recordClaude · ChatGPT · Gemini
- Build a simple Telegram or Discord botClaude · ChatGPT · Gemini



