ci(release): trust release branch docker checks · openclaw/openclaw@1709464
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -192,16 +192,23 @@ jobs:
|
192 | 192 | env: |
193 | 193 | GH_TOKEN: ${{ github.token }} |
194 | 194 | INPUT_REF: ${{ inputs.ref }} |
| 195 | +WORKFLOW_REF_NAME: ${{ github.ref_name }} |
195 | 196 | shell: bash |
196 | 197 | run: | |
197 | 198 | set -euo pipefail |
198 | 199 | selected_sha="$(git rev-parse HEAD)" |
199 | 200 | trusted_reason="" |
200 | 201 | |
201 | 202 | git fetch --no-tags origin +refs/heads/main:refs/remotes/origin/main |
| 203 | + if [[ "${WORKFLOW_REF_NAME}" =~ ^release/[0-9]{4}\.[1-9][0-9]*\.[1-9][0-9]*$ ]]; then |
| 204 | + git fetch --no-tags origin "+refs/heads/${WORKFLOW_REF_NAME}:refs/remotes/origin/${WORKFLOW_REF_NAME}" |
| 205 | + fi |
202 | 206 | |
203 | 207 | if git merge-base --is-ancestor "$selected_sha" refs/remotes/origin/main; then |
204 | 208 | trusted_reason="main-ancestor" |
| 209 | + elif [[ "${WORKFLOW_REF_NAME}" =~ ^release/[0-9]{4}\.[1-9][0-9]*\.[1-9][0-9]*$ ]] && |
| 210 | + [[ "$selected_sha" == "$(git rev-parse "refs/remotes/origin/${WORKFLOW_REF_NAME}")" ]]; then |
| 211 | + trusted_reason="release-branch-head" |
205 | 212 | elif git tag --points-at "$selected_sha" | grep -Eq '^v'; then |
206 | 213 | trusted_reason="release-tag" |
207 | 214 | else |
@@ -218,7 +225,7 @@ jobs:
|
218 | 225 | |
219 | 226 | if [[ -z "$trusted_reason" ]]; then |
220 | 227 | echo "Ref '${INPUT_REF}' resolved to $selected_sha, which is not trusted for secret-bearing live/E2E checks." >&2 |
221 | | - echo "Allowed refs must be on main, point to a release tag, or match an open PR head in ${GITHUB_REPOSITORY}." >&2 |
| 228 | + echo "Allowed refs must be on main, match the current release branch head, point to a release tag, or match an open PR head in ${GITHUB_REPOSITORY}." >&2 |
222 | 229 | exit 1 |
223 | 230 | fi |
224 | 231 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。