diff --git a/.github/workflows/upgrade-from-latest-release.yml b/.github/workflows/upgrade-from-latest-release.yml index 05e0e8f7d..d32c51f97 100644 --- a/.github/workflows/upgrade-from-latest-release.yml +++ b/.github/workflows/upgrade-from-latest-release.yml @@ -60,10 +60,18 @@ jobs: - name: Run the backend tests run: cd src && npm test + # Because actions/checkout@v2 is called with "ref: master" and without + # "fetch-depth: 0", the local clone does not have the ${GITHUB_SHA} commit. + # Fetch ${GITHUB_REF} to get the ${GITHUB_SHA} commit. Note that a plain + # "git fetch" only fetches "normal" references (refs/heads/* and + # refs/tags/*), and for pull requests none of the normal references include + # ${GITHUB_SHA}, so we have to explicitly tell Git to fetch ${GITHUB_REF}. - name: Fetch the new Git commits - run: git fetch + run: git fetch --depth=1 origin "${GITHUB_REF}" - name: Upgrade to the new Git revision + # For pull requests, ${GITHUB_SHA} is the automatically generated merge + # commit that merges the PR's source branch to its destination branch. run: git checkout "${GITHUB_SHA}" - name: Install all dependencies and symlink for ep_etherpad-lite