Skip to content
Back to skills

Github Actions Style

ASecurity

Apply this user's conventions when creating, changing, or reviewing GitHub Actions workflows and composite actions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsrustshellbashdebugginggitapibackendsecurity

Works with

  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add furedea/agent-config --skill github-actions-style --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Actions Style?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Actions Style
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/furedea-github-actions-style/badge)](https://www.skillsdirectory.com/skills/furedea-github-actions-style)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-actions-style
description: >
    Apply this user's conventions when creating, changing, or reviewing GitHub Actions workflows
    and composite actions.
---

# GitHub Actions Coding Conventions

These patterns are easy to overlook but important for security and reliability.

## 1. Permissions — Whitelist Approach

The default `GITHUB_TOKEN` has read/write access to the repo, which is broader than most jobs need. Grant only what each job actually requires.

```yaml
permissions: {} # workflow level: deny-all

jobs:
    build:
        permissions:
            contents: read # checkout
            pull-requests: write # post comments
```

Common permission keys: `contents`, `issues`, `pull-requests`, `packages`, `id-token` (OIDC), `checks`, `statuses`.

## 2. timeout-minutes

Choose a timeout appropriate for the job — typically 5–15 minutes for CI.

```yaml
jobs:
    build:
        timeout-minutes: 10
```

## 3. Shell Settings

Explicitly specifying `shell: bash` makes GitHub Actions run steps with `bash --noprofile --norc -eo pipefail`, which enables `pipefail`; without it, a failed command in a pipe chain (e.g. `cmd | grep`) can silently succeed. Set it at the `defaults.run` level to apply to all steps in the workflow or job:

```yaml
defaults:
    run:
        shell: bash
```

For debugging, add `set -x` at the top of a `run:` block to print each command and its output to stderr before execution:

```yaml
- run: |
      set -x
      uv run --frozen pytest
```

## 4. Concurrency

When the same workflow can be triggered repeatedly for the same ref (e.g. rapid commits to a PR branch), earlier runs are wasted work. Declare `concurrency` at the workflow level so stale runs are cancelled; use `cancel-in-progress: false` for deploy workflows that must run in order.

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

## 5. Cache Design

- Measure representative cold and warm runs before adding a cache. Prefer
  GitHub's cache backend; use an external backend only when self-hosted runner
  locality and measured transfer time justify its credentials and operating
  cost.
- Include every compatibility boundary in the primary key. Use partial matches
  only when the consumer validates and reconciles stale contents; otherwise
  require an exact match. Always keep a correct cache-miss fallback.
- Account for cache scope: pull-request caches are scoped to their merge refs
  and are not reusable by the default branch or sibling pull requests.
- Treat default-branch cache contents as readable by pull requests. Do not
  cache broad paths that may contain credentials. When using an external shared
  backend, do not let untrusted workflows write caches that privileged
  workflows later execute.

## 6. Workflow File Names

Name workflow files in kebab-case with the `.yml` extension (e.g. `release-please.yml`). This is the GitHub Actions convention and an exception to the general underscore rule for file names.

## 7. Composite Actions

zizmor is not run on composite actions (`action.yml`). Pass `inputs.*` and other untrusted context to a `run:` step through `env:`, never by interpolating `${{ }}` into the script.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.