File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 env :
4646 RELEASE_TARGET : ${{ inputs.target }}
4747
48- - name : Verify target is latest green CI commit on main
49- env :
50- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51- run : |
52- set -euo pipefail
53-
54- target_sha=$(git rev-parse HEAD)
55- latest_green_sha=$(gh api \
56- "/repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs?branch=main&status=completed&per_page=20" \
57- --jq '.workflow_runs[] | select(.conclusion == "success") | .head_sha' \
58- | head -n 1)
59-
60- if [[ -z "$latest_green_sha" ]]; then
61- echo "No successful CI run found for main." >&2
62- exit 1
63- fi
64-
65- if [[ "$target_sha" != "$latest_green_sha" ]]; then
66- echo "Release target must match the latest successful CI run on main." >&2
67- echo "Checked out target: $target_sha" >&2
68- echo "Latest green main SHA: $latest_green_sha" >&2
69- exit 1
70- fi
71-
7248 - name : Set up gh-aw CLI
7349 uses : github/gh-aw-actions/setup-cli@f8495a686e66770ae977f82732f34d7340ee42a4 # v0.72.1
7450 with :
You can’t perform that action at this time.
0 commit comments