Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

github-actions-validatorGitHub actions validator 搜索

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

3,403

周安装

139

GitHub Stars

197

下载量

1,101
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-actions-validator(GitHub actions validator 搜索)
来源仓库:https://github.com/akin-ozer/cc-devops-skills
仓库路径:skills/github-actions-validator
安装命令:
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill github-actions-validator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill github-actions-validator

简介

用于验证 GitHub Actions 工作流的正确性和安全性。

  • 适合在工作流文件中检测错误、安全风险和最佳实践问题。
  • 通过 npx 从 GitHub 安装后,运行脚本完成验证与修复。
  • 需要 GITHUB_TOKEN 并具有相应读写权限才能执行完整检查。
  • 注意部分警告可能为误报,需人工复核关键操作。github-actions-validator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GitHub Actions Validator

Overview

Validate and test GitHub Actions workflows, custom actions, and public actions using industry-standard tools (actionlint and act). This skill provides comprehensive validation including syntax checking, static analysis, local workflow execution testing, and action verification with version-aware documentation lookup.

Trigger Phrases

Use this skill when the request includes phrases like:

  • "validate this GitHub Actions workflow"
  • "check my .github/workflows/*.yml file"
  • "debug actionlint errors"
  • "test this workflow locally with act"
  • "verify GitHub Action versions or deprecations"

When to Use This Skill

Use this skill when:

  • Validating workflow files: Checking .github/workflows/*.yml for syntax errors and best practices
  • Testing workflows locally: Running workflows with act before pushing to GitHub
  • Debugging workflow failures: Identifying issues in workflow configuration
  • Validating custom actions: Checking composite, Docker, or JavaScript actions
  • Verifying public actions: Validating usage of actions from GitHub Marketplace
  • Pre-commit validation: Ensuring workflows are valid before committing

Required Execution Flow

Every validation run should follow these steps in order.

Step 1: Set Skill Path and Run Validation

Run commands from the repository root that contains .github/workflows/.

SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
bash "$SKILL_DIR/scripts/validate_workflow.sh" <workflow-file-or-directory>

Step 2: Map Each Error to a Reference

For each actionlint/act error, consult the mapping table below, then extract the matching fix pattern.

Step 3: Apply Minimal-Quote Policy

For each issue:

  1. Include the exact error line from tool output.
  2. Quote only the smallest useful snippet from references/ (prefer <=8 lines).
  3. Paraphrase the rest and cite the source file/section.
  4. Show corrected workflow code.

Step 4: Handle Unmapped Errors Explicitly

If an error does not match any mapping:

  1. Label it as UNMAPPED.
  2. Capture exact tool output, workflow file, and line number (if available).
  3. Check references/common_errors.md general sections first.
  4. If still unresolved, search official docs with the exact error string.
  5. Mark the fix as provisional until post-fix rerun passes.

Step 5: Verify Public Action Versions

For each uses: owner/action@version:

  1. Check references/action_versions.md.
  2. For unknown actions, verify against official docs.
  3. Confirm required inputs and deprecations.

Offline mode behavior:

  • If network/doc lookup is unavailable, rely on references/action_versions.md only.
  • Mark unknown actions as UNVERIFIED-OFFLINE.
  • Do not claim "latest" version without an online verification pass.

Step 6: Mandatory Post-Fix Rerun

After applying fixes, rerun validation before finalizing:

SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
bash "$SKILL_DIR/scripts/validate_workflow.sh" <workflow-file-or-directory>

Step 7: Provide Final Summary

Final output should include:

  • Issues found and fixes applied
  • Any UNMAPPED or UNVERIFIED-OFFLINE items
  • Post-fix rerun command and result
  • Remaining warnings/risk notes

Error Type to Reference File Mapping

Error Pattern in OutputReference File to ReadSection to Quote
runs-on:, runner, ubuntu, macos, windowsreferences/runners.mdRunner labels
cron, schedulereferences/common_errors.mdSchedule Errors
${{, expression, if:references/common_errors.mdExpression Errors
needs:, job, dependencyreferences/common_errors.mdJob Configuration Errors
uses:, action, inputreferences/common_errors.mdAction Errors
untrusted, injection, securityreferences/common_errors.mdScript Injection section
syntax, yaml, unexpectedreferences/common_errors.mdSyntax Errors
docker, containerreferences/act_usage.mdTroubleshooting
@v3, @v4, deprecated, outdatedreferences/action_versions.mdVersion table
workflow_call, reusable, oidcreferences/modern_features.mdRelevant section
glob, path, paths:, patternreferences/common_errors.mdPath Filter Errors

Example: Complete Error Handling Workflow

User's workflow has this error:

runs-on: ubuntu-lastest

Step 1 - Script output:

label "ubuntu-lastest" is unknown

Step 2 - Read references/runners.md or references/common_errors.md: Find the "Invalid Runner Label" section.

Step 3 - Quote the fix to user:

Error: label "ubuntu-lastest" is unknown Cause: Typo in runner label (from references/common_errors.md): ``yaml # Bad runs-on: ubuntu-lastest # Typo ` **Fix** (from references/common_errors.md): `yaml # Good runs-on: ubuntu-latest ` **Valid runner labels** (from references/runners.md): - ubuntu-latest, ubuntu-24.04, ubuntu-22.04 - windows-latest, windows-2025, windows-2022 - macos-latest, macos-15, macos-14`

Step 4 - Provide corrected code:

runs-on: ubuntu-latest

Quick Start

Set once per shell session:

SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"

Initial Setup

bash "$SKILL_DIR/scripts/install_tools.sh"

This installs act (local workflow execution) and actionlint (static analysis) to scripts/.tools/.

Basic Validation

# Validate a single workflow
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml

# Validate all workflows
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/

# Lint-only (fastest)
bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/ci.yml

# Test-only with act (requires Docker)
bash "$SKILL_DIR/scripts/validate_workflow.sh" --test-only .github/workflows/

Core Validation Workflow

1. Static Analysis with actionlint

Start with static analysis to catch syntax errors and common issues:

bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/ci.yml

What actionlint checks: YAML syntax, schema compliance, expression syntax, runner labels, action inputs/outputs, job dependencies, CRON syntax, glob patterns, shell scripts, security vulnerabilities.

2. Local Testing with act

After passing static analysis, test workflow execution:

bash "$SKILL_DIR/scripts/validate_workflow.sh" --test-only .github/workflows/

Note: act has limitations - see references/act_usage.md.

3. Full Validation

bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml

Default behavior if tools/runtime are unavailable:

  • If act is missing, full validation falls back to actionlint-only.
  • If Docker is unavailable, full validation skips act and continues with actionlint.
  • --check-versions works in offline/local mode using references/action_versions.md.

Validating Resource Types

Workflows

# Single workflow
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/ci.yml

# All workflows
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/

Key validation points: triggers, job configurations, runner labels, environment variables, secrets, conditionals, matrix strategies.

Custom Local Actions

Create a test workflow that uses the custom action, then validate:

bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/test-custom-action.yml

Public Actions

When workflows use public actions (e.g., actions/checkout@v6):

  1. Check references/action_versions.md first
  2. Use official docs (or web search) for unknown actions
  3. Verify required inputs and version
  4. Check for deprecation warnings
  5. Run validation script

If offline:

  • Mark unknown versions as UNVERIFIED-OFFLINE
  • Avoid "latest/current" claims until online verification is possible

Search format: "[action-name] [version] github action documentation"

Reference File Consultation Guide

Mandatory Reference Consultation

SituationReference FileAction
actionlint reports any mapped errorreferences/common_errors.mdFind matching error and apply minimal quote policy
actionlint reports unmapped errorreferences/common_errors.md + official docsLabel as UNMAPPED, capture exact output and verify by rerun
act fails with Docker/runtime errorreferences/act_usage.mdCheck Troubleshooting section
act fails but workflow works on GitHubreferences/act_usage.mdRead Limitations section
User asks about actionlint configreferences/actionlint_usage.mdProvide examples
User asks about act optionsreferences/act_usage.mdRead Advanced Options
Security vulnerability detectedreferences/common_errors.mdQuote minimal safe fix snippet
Validating action versionsreferences/action_versions.mdCheck version table and offline note
Using modern featuresreferences/modern_features.mdCheck syntax examples
Runner questions/errorsreferences/runners.mdCheck labels and availability

Script Output to Reference Mapping

Output PatternReference File
[syntax-check], parse, YAML errorscommon_errors.md - Syntax Errors
[expression], ${{, condition parsingcommon_errors.md - Expression Errors
[action], uses:, input/output mismatchcommon_errors.md - Action Errors
[events] with CRON/schedule textcommon_errors.md - Schedule Errors
potentially untrusted, injection warningscommon_errors.md - Security section
[runner-label] or unknown runs-on labelrunners.md
[job-needs] dependency errorscommon_errors.md - Job Configuration Errors
[glob], paths, pattern errorscommon_errors.md - Path Filter Errors
Docker/pull/image errors from actact_usage.md - Troubleshooting
No pattern matchcommon_errors.md + official docs (label UNMAPPED)

Reference Files Summary

FileContent
references/act_usage.mdAct tool usage, commands, options, limitations, troubleshooting
references/actionlint_usage.mdActionlint validation categories, configuration, integration
references/common_errors.mdCommon errors catalog with fixes
references/action_versions.mdCurrent action versions, deprecation timeline, SHA pinning
references/modern_features.mdReusable workflows, SBOM, OIDC, environments, containers
references/runners.mdGitHub-hosted runners (ARM64, GPU, M2 Pro, deprecations)

Troubleshooting

IssueSolution
"Tools not found"Run bash "$SKILL_DIR/scripts/install_tools.sh"
"Docker daemon not running"Start Docker or use --lint-only
"Permission denied"Run chmod +x "$SKILL_DIR"/scripts/*.sh
act fails but GitHub worksSee references/act_usage.md Limitations

Debug Mode

actionlint -verbose .github/workflows/ci.yml  # Verbose actionlint
act -v                                         # Verbose act
act -n                                         # Dry-run (no execution)

Best Practices

  1. Always validate locally first - Catch errors before pushing
  2. Use actionlint in CI/CD - Automate validation in pipelines
  3. Pin action versions - Use @v6 not @main for stability; SHA pinning for security
  4. Keep tools updated - Regularly update actionlint and act
  5. Use official docs for unknown actions - Verify usage and versions
  6. Check version compatibility - See references/action_versions.md
  7. Enable shellcheck - Catch shell script issues early
  8. Review security warnings - Address script injection issues

Limitations

  • act limitations: Not all GitHub Actions features work locally
  • Docker requirement: act requires Docker to be running
  • Network actions: Some GitHub API actions may fail locally
  • Private actions: Cannot validate without access
  • Runtime behavior: Static analysis cannot catch all issues
  • File location: act can only validate workflows in .github/workflows/ directory; files outside (like examples/) can only be validated with actionlint

Quick Examples

Example 1: Pre-commit Validation

SKILL_DIR="devops-skills-plugin/skills/github-actions-validator"
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/
git add .github/workflows/ && git commit -m "Update workflows"

Example 2: Debug Failing Workflow

bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only .github/workflows/failing.yml
# Fix issues
bash "$SKILL_DIR/scripts/validate_workflow.sh" .github/workflows/failing.yml

Complete Worked Example: Multi-Error Workflow

This example demonstrates the full assistant workflow for handling multiple errors.

User's Problematic Workflow

name: Broken CI
on:
  schedule:
    - cron: '0 0 * * 8'  # ERROR 1
jobs:
  build:
    runs-on: ubuntu-lastest  # ERROR 2
    steps:
      - uses: actions/checkout@v3  # ERROR 3 (outdated)
      - run: echo ${{ github.event.issue.title }}  # ERROR 4 (security)
  deploy:
    needs: biuld  # ERROR 5 (typo)
    runs-on: ubuntu-latest
    steps:
      - run: echo "Deploying"

Step 1: Run Validation

bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only workflow.yml

Output:

[ERROR] invalid CRON format "0 0 * * 8"
[ERROR] label "ubuntu-lastest" is unknown
[WARN] "github.event.issue.title" is potentially untrusted
[ERROR] job "deploy" needs job "biuld" which does not exist

Step 2-3: Consult References and Quote Fixes


Error 1: Invalid CRON Expression

*From references/common_errors.md - Schedule Errors:*

Cause: Day of week 8 doesn't exist (valid: 0-6, where 0 = Sunday) ``yaml # Bad schedule: - cron: '0 0 * * 8' # Day 8 doesn't exist # Good schedule: - cron: '0 0 * * 0' # Sunday ` **CRON format:** minute hour day month weekday` - Weekday: 0-6 (0 = Sunday)

Fix: Change 8 to 0 (Sunday) or 1-6 for Monday-Saturday.


Error 2: Invalid Runner Label

*From references/common_errors.md - Job Configuration Errors and references/runners.md:*

Cause: Typo in runner label ``yaml # Bad runs-on: ubuntu-lastest # Typo # Good runs-on: ubuntu-latest ` **Valid labels (from references/runners.md):** - ubuntu-latest (Ubuntu 24.04) - ubuntu-24.04, ubuntu-22.04 - macos-latest (macOS 15) - windows-latest` (Windows Server 2022)

Fix: Change ubuntu-lastest to ubuntu-latest.


Error 3: Outdated Action Version

*From references/action_versions.md:*

| Action | Current Version | Minimum Supported | | --- | --- | --- | | actions/checkout | v6 | v4 | SHA Pinning Best Practice: ``yaml # Recommended: SHA pinning with version comment - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 ``

Fix: Update from @v3 to @v6 (or SHA-pinned version).


Error 4: Security Vulnerability (Script Injection)

*From references/common_errors.md - Expression Errors:*

Warning: Potential script injection via untrusted input ``yaml # Bad - vulnerable to injection run: echo ${{ github.event.issue.title }} # Good - use environment variables env: TITLE: ${{ github.event.issue.title }} run: echo "$TITLE" `` Why: Untrusted input (issue titles, PR bodies, commit messages) can contain malicious commands. Using environment variables sanitizes the input.

Fix: Pass untrusted input through environment variable.


Error 5: Undefined Job Dependency

*From references/common_errors.md - Job Configuration Errors:*

Error: Job 'deploy' depends on job 'biuld' which does not exist ``yaml # Bad jobs: build: runs-on: ubuntu-latest deploy: needs: biuld # Typo # Good jobs: build: runs-on: ubuntu-latest deploy: needs: build ``

Fix: Change biuld to build.


Step 4: Provide Corrected Workflow

name: Fixed CI
on:
  schedule:
    - cron: '0 0 * * 0'  # Fixed: Sunday (0-6 valid)
jobs:
  build:
    runs-on: ubuntu-latest  # Fixed: typo corrected
    steps:
      - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3  # v6.0.0 - Fixed: updated version
      - name: Process issue
        env:
          TITLE: ${{ github.event.issue.title }}  # Fixed: use env var
        run: echo "$TITLE"
  deploy:
    needs: build  # Fixed: typo corrected
    runs-on: ubuntu-latest
    steps:
      - run: echo "Deploying"

Step 5: Mandatory Rerun

bash "$SKILL_DIR/scripts/validate_workflow.sh" --lint-only workflow.yml

Expected rerun result:

  • No previous errors reproduced
  • Remaining warnings, if any, are documented explicitly

Step 6: Summary

ErrorTypeFix Applied
CRON 0 0 * * 8ScheduleChanged to 0 0 * * 0
ubuntu-lastestRunnerChanged to ubuntu-latest
checkout@v3Outdated ActionUpdated to @v6.0.0 (SHA-pinned)
Direct ${{}} in runSecurityWrapped in environment variable
needs: biuldJob DependencyChanged to needs: build

Recommendations:

  • Run bash "$SKILL_DIR/scripts/validate_workflow.sh" --check-versions regularly
  • Use SHA pinning for all actions in production workflows
  • Always pass untrusted input through environment variables

Done Criteria

Validation work is complete when all are true:

  • Trigger matched and correct validation mode selected.
  • Each mapped error includes source reference and minimal quote.
  • Each unmapped error is labeled UNMAPPED with exact output captured.
  • Public action versions are verified, or marked UNVERIFIED-OFFLINE.
  • Post-fix rerun executed and result reported.

Summary

  1. Setup: Install tools with install_tools.sh
  2. Validate: Run validate_workflow.sh on workflow files
  3. Fix: Address issues using reference documentation
  4. Rerun: Verify fixes with a mandatory post-fix validation run
  5. Search: Use official docs to verify unknown actions
  6. Commit: Push validated workflows with confidence

For detailed information, consult the appropriate reference file in references/.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.88%
按下载量换算417

Claude

27.29%
按下载量换算300

Cursor

17.76%
按下载量换算196

Gemini CLI

8.81%
按下载量换算97

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills