#!/usr/bin/env sh set -euo pipefail remote=`git remote |head -1` repoNwo=`git remote get-url $remote | sed 's/.*://;s/\.git//'` repoNodeId=`gh api repos/$repoNwo --jq '.node_id'` branch=`git rev-parse --abbrev-ref HEAD` newBranch="new-branch-$RANDOM" contents=`echo -e 'Hello, GraphQL!\n' | base64` expectedHeadOid=`git rev-parse HEAD` curl https://api.github.com/graphql --silent \ -H "Authorization: bearer $TOKEN" \ -H "Accept: application/vnd.github.update-refs-preview+json" \ --data @- <