feat(action): trust-check/validate-source-branch - Validate PR source branch
@aRustyDev 已经在做这个了。
开始于 2026年1月27日。
评估
这个 Issue 还没有评估数据。
描述
Parent Epic
Part of #22 (Atomic Release Pipeline Actions)
Priority
P2 - Security validation for W5
Description
Create a composite action that validates a PR's source branch matches an expected pattern.
Used to enforce that PRs to protected branches come from expected source branches.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
source-branch |
Yes | - | The source branch of the PR |
allowed-pattern |
Yes | - | Allowed branch pattern (glob supported) |
Outputs
| Output | Description |
|---|---|
valid |
"true" if branch matches pattern |
pattern-matched |
The pattern that matched (for multiple patterns) |
Usage Example
# Single pattern
- uses: arustydev/gha/actions/trust-check/validate-source-branch@v1
with:
source-branch: ${{ github.head_ref }}
allowed-pattern: "charts/*"
# Multiple patterns (comma-separated)
- uses: arustydev/gha/actions/trust-check/validate-source-branch@v1
with:
source-branch: ${{ github.head_ref }}
allowed-pattern: "charts/*,hotfix/*,release/*"
Source Reference
helm-charts/.github/scripts/attestation-lib.sh:
validate_source_branch()(lines 296-314)
Implementation Notes
- Support glob patterns (e.g.,
charts/*) - Support multiple patterns (comma-separated)
- Fail with clear error message on mismatch
- 主要语言
- Shell
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aRustyDev/gh 的其他 Issue
-
dependencies github-actions
难度 1/5 1 小时以内 新手友好度 10/100
-
dependencies github-actions
难度 1/5 1 小时以内 新手友好度 15/100
-
dependencies github-actions
难度 1/5 1 小时以内 新手友好度 50/100
-
dependencies github-actions
难度 2/5 1-3 小时 新手友好度 20/100
-
dependencies github-actions
难度 2/5 1-3 小时 新手友好度 10/100
相似的 Issue
-
out-of-date
难度 1/5 1 小时以内 新手友好度 82/100
CachyOS/CachyOS-PKGBUILDS#1917 ·
维护者通常 1 天内回复
-
package-update
难度 2/5 1-3 小时 新手友好度 78/100
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
EmbarkStudios/cargo-about#323 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
vllm-project/vllm-metal#841 ·
维护者通常 1 天内回复