build_tools/release.sh: approve macos-codesign github environment

This commit is contained in:
Johannes Altmanninger
2025-09-18 20:02:40 +02:00
parent 955345dd5b
commit 64bbd41f81

View File

@@ -20,6 +20,7 @@ fi
for tool in \ for tool in \
bundle \ bundle \
gh \ gh \
jq \
ruby \ ruby \
timeout \ timeout \
; do ; do
@@ -137,6 +138,34 @@ rm -rf "$tmpdir"
" | sed 's,^\s*| \?,,')" " | sed 's,^\s*| \?,,')"
) )
# Approve macos-codesign
# TODO what if current user can't approve?
sleep 5
pending_deployments_endpoint=/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments
environment_id=$(
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$pending_deployments_endpoint" |
jq .[].environment.id
)
if [ -n "$environment_id" ]; then
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$pending_deployments_endpoint" \
-X POST \
-d '
{
"environment_ids": ['"$environment_id"'],
"state": "approved",
"comment": "Approved via ./build_tools/release.sh"
}
'
fi
# # Uncomment this to wait the full workflow run (i.e. macOS packages). # # Uncomment this to wait the full workflow run (i.e. macOS packages).
# # Also note that --exit-status doesn't fail reliably. # # Also note that --exit-status doesn't fail reliably.
# gh run view "$run_id" --verbose --log-failed --exit-status # gh run view "$run_id" --verbose --log-failed --exit-status