Skip to content
Back to skills

Github Actions Hardening

ASecurity

Harden GitHub Actions: least-privilege tokens, pinned actions, safe triggers, OIDC and secret handling

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentrustgitdevopssecurity

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill github-actions-hardening --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Actions Hardening?

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

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

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
---
description: Harden GitHub Actions: least-privilege tokens, pinned actions, safe triggers, OIDC and secret handling
profile: standard
tags: ci, security, devops, supply-chain
---

# GitHub Actions hardening

Use when writing or reviewing workflows, especially ones that run agents.

## Permissions
- Set `permissions:` at the top of every workflow, starting from `contents: read`, and grant more per job only where needed.
- Use OIDC (`id-token: write`) to get short-lived cloud credentials instead of long-lived secrets.

## Third-party actions
Pin actions to a full commit SHA (with the version in a comment), and review what they do. Tags can be moved. Let Dependabot propose updates.

## Triggers
- `pull_request_target` and `workflow_run` run with secrets on code from forks. Never check out and run the PR's code in them.
- For `issue_comment` and similar triggers, check `author_association` before doing anything privileged. This matters most for AI agents that anyone can trigger with a comment.

## Injection
Never interpolate untrusted input (`github.event.issue.title`, branch names, PR bodies) directly into `run:` scripts. Pass it through `env:` and quote it.

## Secrets
Scope secrets to environments with required reviewers for production. Do not echo secrets, and avoid `set -x` in steps that use them.

## Verify
Run `anvil shield` (it has CI rules for these cases) and `actionlint`. Check that fork PRs cannot reach secrets.

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 development →

Comments

Loading comments…

Newsletter

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