用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/abcxyz/github-token-minter --skill validate-minty-config命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | validate-minty-config |
| description | Validates Minty configuration files using the `tools validate-cfg` command. |
This skill provides instructions for validating Minty configuration files using the CLI.
To validate a configuration file, run:
go run github.com/abcxyz/github-token-minter/cmd/minty@main tools validate-cfg --minty-file <path/to/config.yaml>
--scope <scope>: Validate against a specific scope.--token <token_json>: Validate using a specific token (JSON string).[!NOTE] If any required arguments (like the config file path) or optional arguments (like scope or token) are not provided or known from context, ask the user for them before running the command.
If the user provides a server log entry (JSON), extract the following fields:
jsonPayload.claims as the value for --token.jsonPayload.request.scope as the value for --scope.Example Extraction:
Given a log entry:
{
"jsonPayload": {
"request": { "scope": "my-scope" },
"claims": { "iss": "..." }
}
}
Run:
go run github.com/abcxyz/github-token-minter/cmd/minty@main tools validate-cfg \
--minty-file <config> \
--scope "my-scope" \
--token '{"iss": "..."}'
If a log entry is provided, you can also fetch the configuration file directly from GitHub using the repository and ref claims.
Extract Repo and Ref:
repository: from jsonPayload.claims.repository (e.g., owner/repo).ref: from jsonPayload.claims.ref (e.g., refs/heads/main or refs/tags/v1).Download Config:
Use gh api to download the file to a temporary location. Valid paths are typically .github/minty.yaml or .github/minty.yml.
# Example for ref 'refs/heads/main'
gh api repos/<owner>/<repo>/contents/.github/minty.yaml?ref=<ref> \
-H "Accept: application/vnd.github.raw" > minty.yaml
Run Validation:
Use the downloaded minty.yaml as the --minty-file.
go run github.com/abcxyz/github-token-minter/cmd/minty@main tools validate-cfg --minty-file config.yaml --scope "my-scope" --token '{"iss":"..."}'
[x] indicates a failing condition.[+] indicates a passing condition.When a validation fails, the tool outputs a decision tree. Use this to pinpoint exactly which claim failed.
Example Failure Output:
Eval decision:
[x] AND -> false
├── [+] AND -> true
│ ├── [+] EQUALS -> true
│ │ ├── [v] Select 'assertion.job_workflow_ref' -> ...
...
└── [x] AND -> false
├── [x] EQUALS -> false
│ ├── [v] Select 'assertion.ref' -> refs/heads/wrong-branch
│ └── [v] Lit 'refs/heads/main' -> refs/heads/main
In this example, assertion.ref was refs/heads/wrong-branch but the policy required refs/heads/main. Advise the user to check their token generation or branch name.