Checkout all branches in GitHub Actions (#4437)

By default actions/checkout@v2 only checks out the latest commit of the current branch. Unfortunately, this causes the `git diff` check in `check-pr.sh` to fail, as `master` branch isn't available`.

This change checks out all commits of all branches, which allows `git diff` to work correctly.

Ideally, I'd like to use the `ref` setting of actions/checkout@v2, but that only supports a single ref so it's not possible to checkout the PR branch _and_ `master` branch at the same time.
This commit is contained in:
Jamie Magee
2020-10-05 17:23:08 +02:00
committed by GitHub
parent 2c7e2351e8
commit 34f8c610df
2 changed files with 3 additions and 1 deletions

View File

@@ -12,6 +12,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up PR environment
if: github.event.number != null