Backstory:
- dependabot sent us a PR that bumped a bunch of NPM dependency versions, and the
package-lock.json
file in that PR was incorrect, causingnpm ci
to fail. - We merged this PR before we realised this.
- We noticed the issue and created two PRs to fix it:
- One reverted the bad dependabot PR.
- One modified our CI workflow action to use
npm ci
instead ofnpm install
, so that we would notice if any future PR updatedpackage.json
without updatingpackage-lock.json
to match.
- At some point during this time dependabot sent us some more PRs that are not defective.
Question:
I have a PR that I can check via gh pr checkout <NNNN>
, and when I subsequently run tests in the PR branch they pass. I can also merge that branch into the target branch locally, using git merge <PR_BRANCH>
(or with --squash
), and the combination of target branch + pr branch also passes tests.
However, when GitHub runs the tests for this PR the tests fail. This seems to be bacause our workflow uses the checkout action to obtain the code to test, checking out PR merge branch refs/pull/PULL_REQUEST_NUMBER/merge
, and apparently this merge branch is defective, possibly because the target branch was defective at the time the PR was created.
How do I get GitHub to update the PR merge branch, so that it is up-to-date with respect to the (now fixed) target branch?
Additional Info
The GitHub docs mention an “update branch” button, but it appears that this button is for updating the PR branch (by merge or rebase from the target branch), not updating the PR merge branch.