Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge Github Actions Hardening?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-github-actions-hardening)
---
name: forge-github-actions-hardening
description: "Harden GitHub Actions: least-privilege tokens, pinned actions, safe triggers, OIDC and secret handling"
---
<!-- Generated from catalog/skills/github-actions-hardening/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# 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 `forge shield` (it has CI rules for these cases) and `actionlint`. Check that fork PRs cannot reach secrets.