diff --git a/.github/workflows/make_prs_for_other_repos.yaml b/.github/workflows/make_prs_for_other_repos.yaml index 56a270228..21c54c96c 100644 --- a/.github/workflows/make_prs_for_other_repos.yaml +++ b/.github/workflows/make_prs_for_other_repos.yaml @@ -15,6 +15,7 @@ jobs: steps: # Outputs: # - pr-number: The PR number from the branch name (exits if no PR exists). + # - auspice-sha: The GitHub-managed merge ref. Used for npm install. - name: Detect PR from branch id: detect-pr run: | @@ -23,7 +24,9 @@ jobs: echo "ERROR: This branch is not associated with a PR in Auspice." >&2 exit 1 fi + MERGE_SHA=$(gh pr view $GITHUB_REF_NAME --repo nextstrain/auspice --json 'potentialMergeCommit' --jq '.potentialMergeCommit.oid') echo "::set-output name=pr-number::$PR_NUMBER" + echo "::set-output name=auspice-sha::$MERGE_SHA" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -42,7 +45,7 @@ jobs: working-directory: ${{ env.DESTINATION_REPO_DIR }} run: | npm ci - npm install nextstrain/auspice#${GITHUB_SHA} + npm install nextstrain/auspice#${{ steps.detect-pr.outputs.auspice-sha }} git add package.json package-lock.json - name: Create Pull Request for testing on nextstrain.org repo @@ -59,6 +62,9 @@ jobs: body: | This PR has been created to test nextstrain.org running Auspice with changes from https://github.com/nextstrain/auspice/pull/${{ steps.detect-pr.outputs.pr-number }}. + Note that Auspice has been installed with changes from both the PR's source and target branches. + This will surface any issues that can arise from merging the PR in Auspice. To address these issues locally, update the source branch (e.g. with a git rebase). + This message and corresponding commits were automatically created by a GitHub Action from [nextstrain/auspice](https://github.com/nextstrain/auspice). draft: true delete-branch: true