-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set nextstrain.org PRs to manual trigger
This allows us to only create review PRs in the downstream repo when necessary, reducing the amount of excessive automated PRs. Note that the title and description of the PR have been updated to use the source ref (e.g. branch, tag) rather than PR number, since that is not guaranteed or retrievable with the manual trigger.
- Loading branch information
Showing
1 changed file
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: "Make PRs for Nextstrain projects which depend on Auspice" | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
make-pr-on-nextstrain-dot-org: # <job_id> | ||
runs-on: ubuntu-latest | ||
|
@@ -13,29 +13,27 @@ jobs: | |
with: | ||
repository: nextstrain/nextstrain.org | ||
- name: Install Auspice from PRs HEAD commit | ||
if: ${{ github.event_name == 'pull_request' }} | ||
# Note: $GITHUB_SHA is _not_ the same commit as the HEAD commit on the PR branch | ||
# see https://github.community/t/github-sha-not-the-same-as-the-triggering-commit/18286/2 | ||
shell: bash | ||
run: | | ||
AUSPICE_COMMIT=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) | ||
AUSPICE_COMMIT=$(cat $GITHUB_EVENT_PATH | jq -r .workflow_dispatch.head.sha) | ||
echo "auspice_commit=$AUSPICE_COMMIT" >> $GITHUB_ENV | ||
npm ci | ||
npm install nextstrain/auspice#${AUSPICE_COMMIT} | ||
git add package.json package-lock.json | ||
- name: Create Pull Request for testing on nextstrain.org repo | ||
if: ${{ github.event_name == 'pull_request' }} | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.NEXTSTRAIN_BOT_PAT }} | ||
branch: "auspice-pr-${{ github.event.pull_request.number }}" | ||
branch: "auspice-pr-${{ github.event.workflow_dispatch.ref }}" | ||
commit-message: "[testing only] upgrade auspice to ${{ env.auspice_commit }}" | ||
author: 'nextstrain-bot <[email protected]>' | ||
committer: 'nextstrain-bot <[email protected]>' | ||
title: '[bot] [DO NOT MERGE] Test auspice PR ${{ github.event.pull_request.number }}' | ||
title: '[bot] [DO NOT MERGE] Test auspice ref ${{ github.event.workflow_dispatch.ref }}' | ||
body: | | ||
This PR has been created to test Auspice from [PR ${{ github.event.pull_request.number }}](https://github.com/nextstrain/auspice/pull/${{ github.event.pull_request.number }}) | ||
This PR has been created to test Auspice from [ref ${{ github.event.workflow_dispatch.ref }}](https://github.com/nextstrain/auspice/pull/${{ github.event.workflow_dispatch.ref }}) | ||
This message and corresponding commits were automatically created by a GitHub Action from [nextstrain/auspice](https://github.com/nextstrain/auspice) | ||
draft: true | ||
|