Skip to content

CICD-183 · Verify a tag belongs to the release commit ​

Encyclopedia · Workflow security fundamentals · All snippets

Previous · CICD-182 · Next · CICD-184

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites trusted repository, verified inputs and read-only default access.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters GITHUB_SHA, RELEASE_TAG.

2. Copy the snippet ​

bash
test "$(git rev-list -n 1 "${RELEASE_TAG:?}")" = "${GITHUB_SHA:?}"

3. How it works ​

The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.

4. Verify the result ​

Fetch the reviewed tag and check policy does not allow untrusted tag changes.

Validation syntax-validated (Bash parse). Status definitions.