Skip to content

Commit

Permalink
Create preview PRs using labels
Browse files Browse the repository at this point in the history
Benefits:

1. Ease of use - straight from the PR page
2. Workflow runs will show on the PR checks
3. PRs will reflect changes after merging with the base branch (opposed
   to changes on the head branch alone)
  • Loading branch information
victorlin committed Apr 11, 2024
1 parent d38af86 commit bad6acc
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 34 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/make_prs_for_other_repos.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/preview_on_auspice_us.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Preview on auspice.us"
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled

workflow_dispatch:

jobs:
auspice-us:
if: |
github.event.label.name == 'preview on auspice.us' ||
contains( github.event.pull_request.labels.*.name, 'preview on auspice.us')
uses: ./.github/workflows/preview_on_downstream_repo.yaml
secrets: inherit
with:
repository: nextstrain/auspice.us
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Make PR for a repository which depends on Auspice"
name: "Preview on downstream repo"
on:
workflow_call:
inputs:
Expand All @@ -10,7 +10,7 @@ on:
type: string
default: .
jobs:
make-pr-on-downstream-repo:
run:
# I don't see this being used for tags, so ensure it's only run on branches
# to make subsequent logic and wording easier.
if: github.ref_type == 'branch'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/preview_on_nextstrain_org.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Preview on nextstrain.org"
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled

workflow_dispatch:

jobs:
auspice-us:
if: |
github.event.label.name == 'preview on nextstrain.org' ||
contains( github.event.pull_request.labels.*.name, 'preview on nextstrain.org')
uses: ./.github/workflows/preview_on_downstream_repo.yaml
secrets: inherit
with:
repository: nextstrain/nextstrain.org
directory: auspice-client
7 changes: 1 addition & 6 deletions DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ A Heroku pipeline for this repository is connected to GitHub under the nextstrai

#### Test on downstream repositories

Additionally, a GitHub Actions workflow has been set up to generate PRs in downstream repositories that reflect the new changes in Auspice. To use it:

1. Go to [the workflow page](https://github.com/nextstrain/auspice/actions/workflows/make_prs_for_other_repos.yaml).
2. Select **Run workflow**.
3. Pick the PR branch, select the downstream repositories you wish to test, and **Run workflow**.
4. Wait for the workflow to finish running. The Auspice PR should show new reference links from the generated PRs.
Additionally, a GitHub Actions workflow has been set up to generate PRs in downstream repositories that reflect the new changes in Auspice. To use it, add the label [preview on auspice.us](https://github.com/nextstrain/auspice/labels/preview%20on%20auspice.us) and/or [preview on nextstrain.org](https://github.com/nextstrain/auspice/labels/preview%20on%20nextstrain.org).

## git-lfs

Expand Down

0 comments on commit bad6acc

Please sign in to comment.