Skip to content

Commit

Permalink
Make nextstrain.org PR from Auspice PR merge ref
Browse files Browse the repository at this point in the history
Previously, Auspice was installed from the source branch HEAD directly.
This can fail to catch issues if there are notable changes in the PR
target branch unincorporated in the source branch. Creating the
nextstrain.org PR from the auto-merged ref should surface any
merge-related issues sooner than later.
  • Loading branch information
victorlin committed Oct 6, 2022
1 parent a89046f commit d5637ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/make_prs_for_other_repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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 }}

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d5637ee

Please sign in to comment.