# github-action

Guides Claude Code in generating GitHub Actions workflows with scoped secrets, composite steps, and upstream version checks.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 267 repo stars
- Author: przeprogramowani
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/github-action.mdc
- Updated: 2026-02-20
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/github-action

## What it does

The rule shapes how Claude Code writes CI/CD pipelines. It directs the assistant to scan the project root first, inspecting scripts in `package.json`, Node versions in `.nvmrc`, and variable definitions in `.env.example`. Branch naming is confirmed directly via `git branch -a | cat`.

Workflows must keep environment variables and tokens bound to jobs rather than declared across the entire workflow. Node modules rely on `npm ci`. Repeated logic moves into dedicated composite actions in separate files.

At the end of workflow editing, the agent queries GitHub endpoints via `curl` to grab the latest major releases, verify the source repo is not archived, and inspect `action.yml` when parameters trigger linter errors. Without network reachability and `curl` in the terminal, these upstream checks cannot finish.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/github-action.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/github-action.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/github-action.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/github-action.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/github-action.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/github-action.mdc

## When to use it
- scaffold a GitHub Actions workflow matching local package scripts
- audit third-party actions against GitHub API for archived status
- extract duplicate pipeline steps into standalone composite actions
- scope secrets and environment variables to individual jobs

## Example prompts
- Create a continuous integration workflow for this project following the github-action rule
- Review `.github/workflows/test.yml` and check if any actions are archived or outdated
- Extract repetitive setup steps from our workflows into a composite action

## Similar
- [create-github-action-workflow-specification](https://affpapa.org/en/nevibecode/skills/create-github-action-workflow-specification.md) — skill · 10745 installs
- [local-action-verification](https://affpapa.org/en/nevibecode/skills/local-action-verification.md) — skill · 702 installs
- [github-actions](https://affpapa.org/en/nevibecode/skills/github-actions.md) — skill · 12400 installs
- [github-actions-hardening](https://affpapa.org/en/nevibecode/skills/github-actions-hardening.md) — skill · 2200 installs
- [github-workflow-automation](https://affpapa.org/en/nevibecode/skills/sickn33-github-workflow-automation.md) — skill · 1500 installs
- [crontap-replace-github-actions-cron](https://affpapa.org/en/nevibecode/skills/crontap-replace-github-actions-cron.md) — skill · 1300 installs

From the same set: [przeprogramowani/ai-rules-builder](https://affpapa.org/en/nevibecode/by/przeprogramowani/ai-rules-builder.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
