Replies: 2 comments
|
|
0 replies
Skip checkout for this gate and use the Compare API. - name: Require PR head contains latest base
env:
GH_TOKEN: ${{ github.token }}
run: |
base='${{ github.event.pull_request.base.ref }}'
head='${{ github.event.pull_request.head.sha }}'
behind=$(gh api "repos/${GITHUB_REPOSITORY}/compare/${base}...${head}" --jq '.behind_by')
echo "behind_by=${behind}"
if [ "${behind}" != "0" ]; then
echo "This branch is ${behind} commit(s) behind ${base}"
exit 1
fiThat matches what your Notes:
If you still want a git-only check, fetch only |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is what we are using at the moment:
However, this step is taking upwards of 2 minutes in our large repository.
All reactions