diff --git a/.github/workflows/make_prs_for_other_repos.yaml b/.github/workflows/make_prs_for_other_repos.yaml index db3fd2730..ad927f5ee 100644 --- a/.github/workflows/make_prs_for_other_repos.yaml +++ b/.github/workflows/make_prs_for_other_repos.yaml @@ -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: # runs-on: ubuntu-latest @@ -12,30 +12,24 @@ jobs: uses: actions/checkout@v2 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://gitpro.ttaallkk.topmunity/t/github-sha-not-the-same-as-the-triggering-commit/18286/2 + - name: Install Auspice from source ref HEAD shell: bash run: | - AUSPICE_COMMIT=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) - echo "auspice_commit=$AUSPICE_COMMIT" >> $GITHUB_ENV npm ci - npm install nextstrain/auspice#${AUSPICE_COMMIT} + npm install nextstrain/auspice#${GITHUB_SHA} 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 }}" - commit-message: "[testing only] upgrade auspice to ${{ env.auspice_commit }}" + branch: "auspice-pr-${{ github.event.workflow_dispatch.ref }}" + commit-message: "[testing only] upgrade auspice to ${{ github.sha }}" author: 'nextstrain-bot ' committer: 'nextstrain-bot ' - 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