Skip to content

Conversation

bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Sep 11, 2025

Apparently -F is the correct thing to use. From the code sample on

https://docs.github.com/en/rest/git/refs?apiVersion=2022-11-28#update-a-reference

gh api \
  --method PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/git/refs/REF \
   -f 'sha=aa218f56b14c9653891f9e74264a383fa43fefbd' -F "force=true"

Also, I ran the following locally and verified it worked:

export GITHUB_REPOSITORY=openai/codex
export GITHUB_SHA=305252b2fb2d57bb40a9e4bad269db9a761f7099
gh api \
  repos/${GITHUB_REPOSITORY}/git/refs/heads/latest-alpha-cli \
  -X PATCH \
  -f sha="${GITHUB_SHA}" \
  -F force=true

$GITHUB_REPOSITORY and $GITHUB_SHA should already be available as environment variables for the run step without having to be redeclared in the env section.

@bolinfest bolinfest merged commit 1671541 into main Sep 11, 2025
19 checks passed
@bolinfest bolinfest deleted the pr3486 branch September 11, 2025 18:32
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants