160-github-actions

Rules for writing and reviewing GitHub Actions workflows, which automate tasks such as testing and deployment when changes happen in a repository. They focus on security, speed, maintainability, clear failures, caching, reuse, logging, and input validation.

In plain words
What is it for?
Use them when creating or reviewing GitHub Actions continuous-integration and deployment workflows.
Why use it?
They reduce common workflow problems such as excessive permissions, unclear failures, repeated configuration, slow runs, and unsafe inputs.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/d-padmanabhan/agent-engineering-handbook/160-github-actions
Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 11,842 The whole file, excluding the scripts and references it only reads on demand.
Security scan F 4 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.11842
Opus 5 $0.00005 $0.05921
Sonnet 5 $0.00002 $0.02368
Haiku 4.5 $0.00001 $0.01184

Measured 2d ago against content hash cb68cefa4480, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade F, and why

160-github-actions scanned grade F with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- run: rm -rf dist/

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -f https://staging.acme.com/health || exit 1
rules/160-github-actions.mdc · 1,941 lines

How it starts

The opening of the file, as written. The whole thing — 1,941 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Actions Engineering Ruleset

Audience: engineers writing and reviewing GitHub Actions Goal: secure, fast, maintainable workflows - without over-engineering

GitHub Actions Philosophy (Core Principles)

Core Principles:

  • "Security by default" - Start with zero permissions, grant only what's needed
  • "Fail fast, fail clearly" - Use timeouts, clear error messages, proper exit codes
  • "Cache aggressively, invalidate wisely" - Cache dependencies and artifacts, version keys properly
  • "Composition over duplication" - Use reusable workflows and composite actions
  • "Explicit over implicit" - Document everything, use clear naming, avoid magic
  • "Performance matters" - Parallelize where possible, skip unnecessary runs, optimize caching
  • "Observability is essential" - Use summaries, annotations, structured logging
  • "Trust but verify" - Validate inputs, sanitize outputs, audit dependencies

Applying GitHub Actions Principles:

# BAD: Implicit, insecure, slow
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: npm install && npm test

# GOOD: Explicit, secure, optimized
name: CI Pipeline

on:
  push:
    branches: [main]
    paths:
      - 'src/**'
      - 'package*.json'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions: {}

jobs:
  build:
    name: Build and Test
    runs-on: ubuntu-latest
    timeout-minutes: 30
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v4

      - name: Cache dependencies
        uses: actions/cache@v4
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

      - name: Install dependencies
        run: npm ci

      - name: Run tests
        run: npm test

Note: where your original guidance conflicted with how Actions actually works, I kept your text and added a short Note immediately under it so the doc remains complete and correct.

Read the full file on GitHub · 1,941 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 1,941 lines · 11 tokens per session scan F cb68cefa4480

Subscribe to this mod's changes

160-github-actions is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (15 stars, last pushed 2d ago), licensed MIT. It adds 11 tokens to every session and 11,842 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it F with 4 findings (asks for root, downloads and executes remote code, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.