Workflow YAML Guard

Workflow YAML Guard is a copy-paste React component that stops helps catch workflows that could leak repo secrets to a pull request before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/workflow-yaml-guard
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsHelps catch workflows that could leak repo secrets to a pull request

Was this component page useful?

How do I install Workflow YAML Guard?

pnpm dlx shadcn@latest add @bollard/workflow-yaml-guard

The files land in your project. They're yours to edit.

How do I use Workflow YAML Guard in React?

workflow-yaml-guard-usage.tsx
import { WorkflowYamlGuard } from "@/components/ui/workflow-yaml-guard"

return <WorkflowYamlGuard label=".github/workflows/preview.yml" defaultValue={WORKFLOW} visibility="public" resolveSha={resolveSha} />

What input mistakes does Workflow YAML Guard catch?

  • pull_request_target / workflow_run jobs that check out the PR's code (pwn requests)
  • Untrusted event fields and head_ref interpolated into run scripts
  • Actions pinned to tags instead of a full commit SHA (pin via your resolveSha)
  • Missing or write-all token permissions
  • Secrets echoed, dumped with toJSON or transformed past log masking
  • Self-hosted runners reachable from fork PRs in public repos

What props does Workflow YAML Guard accept?

WorkflowYamlGuard props
PropTypeDefault
value

Controlled workflow YAML.

string—
defaultValue

Initial YAML when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
visibility

Repo visibility. Self-hosted runners reachable from forks are errors on public repos and skipped on private ones.

"public" | "private"—
resolveSha

Looks up the commit SHA for an action's tag (e.g. via the GitHub API). Enables "Pin SHA".

(action: string, ref: string) => Promise<string>—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{line}`, `{detail}`, `{action}`, `{ref}`, `{sha}` are filled in.

Partial<WorkflowYamlGuardMessages>—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is Workflow YAML Guard accessible?

  • Visible <label>; aria-invalid and a role=status issue count
  • Each issue has a button that selects its line, with an aria-label
  • After a fix, focus moves to the next fix or back to the textarea

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Also enforce branch protection, required reviews and restricted token permissions in repository settings.

  • A lightweight, line-aware YAML reader: anchors, complex flow syntax and reusable workflows may be missed
  • Pattern-based review; it does not prove a workflow is safe
  • Composite actions and called workflows are not followed

What validation rules apply to Workflow YAML Guard?

Rules last verified:

Confirmed guidance on using an intermediate environment variable for untrusted input and pinning actions to a full-length commit SHA. GitHub Security Lab's pwn-request articles were not re-fetched this round. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Workflow YAML Guard stop?

Helps catch workflows that could leak repo secrets to a pull request

Also known as

github actions · workflow yaml · ci/cd · pull_request_target · secrets · permissions · pin sha · self-hosted runner

What dependencies does Workflow YAML Guard require?

Workflow YAML Guard facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameWorkflow YAML Guard
Registry identifier@bollard/workflow-yaml-guard
Install commandnpx shadcn@latest add @bollard/workflow-yaml-guard
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Workflow YAML Guard

What form validation mistake does Workflow YAML Guard catch?

Workflow YAML Guard prevents helps catch workflows that could leak repo secrets to a pull request. Flags GitHub Actions workflow patterns that can expose secrets or the repo to pull requests, following GitHub's secure-use guidance. Catches: pull_request_target / workflow_run jobs that check out the PR's code (pwn requests), Untrusted event fields and head_ref interpolated into run scripts, Actions pinned to tags instead of a full commit SHA (pin via your resolveSha), Missing or write-all token permissions, Secrets echoed, dumped with toJSON or transformed past log masking, Self-hosted runners reachable from fork PRs in public repos. Limitation: validate workflow-yaml-guard schemas on backend.

How do I install workflow-yaml-guard with shadcn?

Run `npx shadcn@latest add @bollard/workflow-yaml-guard`. Sources added: registry/default/workflow-yaml-guard/workflow-yaml-guard.tsx, registry/default/workflow-yaml-guard/workflow.ts. Package requirements: lucide-react.

What props customize Workflow YAML Guard?

Workflow YAML Guard accepts `value`, `defaultValue`, `onValueChange`, `visibility`, `resolveSha`. Configures github actions, workflow yaml, ci/cd behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of workflow-yaml-guard?

A lightweight, line-aware YAML reader: anchors, complex flow syntax and reusable workflows may be missed. Pattern-based review; it does not prove a workflow is safe. Composite actions and called workflows are not followed Server requirement: Also enforce branch protection, required reviews and restricted token permissions in repository settings.

How does Workflow YAML Guard meet accessibility guidelines?

Visible <label>; aria-invalid and a role=status issue count. Each issue has a button that selects its line, with an aria-label. After a fix, focus moves to the next fix or back to the textarea. Minimizes errors: pull_request_target vulnerability, github actions injection.

Which components pair with Workflow YAML Guard?