-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Update dataset repos | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
|
||
update-dataset-repo: | ||
|
||
if: github.repository == 'neurodatascience/testpoppy' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TEMPLATE_REPO: neurodatascience/testpoppy | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
fork: | ||
- neurodatascience/testpoppy-ppmi | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ matrix.fork }} | ||
|
||
- name: Get upstream changes | ||
run: | | ||
git remote add upstream https://github.com/${TEMPLATE_REPO}.git | ||
git fetch upstream main | ||
git reset --hard upstream/main | ||
- name: Create Pull Request | ||
id: create-pull-request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
title: Update to match ${{ env.TEMPLATE_REPO }}:main | ||
body: PR created/updated automatically by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action. Will be merged automatically by [automerge-action](https://github.com/pascalgn/automerge-action) if there are no merge conflicts. | ||
token: ${{ secrets.PAT }} | ||
branch: main-upstream | ||
labels: automerge | ||
|
||
# - name: Approve Pull Request | ||
# if: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
# uses: michellewang/auto-approve-action@v3 | ||
# with: | ||
# repository: ${{ matrix.fork }} | ||
# pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
# review-message: PR approved by [auto-approve-action](https://github.com/michellewang/auto-approve-action) GitHub action. | ||
# github-token: ${{ secrets.GH_ACTION_PAT }} | ||
|
||
- name: Automerge Pull Request | ||
id: automerge-pull-request | ||
if: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
uses: pascalgn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
MERGE_LABELS: automerge | ||
MERGE_METHOD: merge | ||
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" | ||
MERGE_DELETE_BRANCH: "false" | ||
MERGE_ERROR_FAIL: "true" | ||
PULL_REQUEST: ${{ matrix.fork }}/${{ steps.create-pull-request.outputs.pull-request-number }} | ||
|
||
- name: Fail job if Pull Request wasn't ready to be merged | ||
if: steps.automerge-pull-request.outputs.mergeResult == 'not_ready' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.setFailed("Pull request #${{ steps.automerge-pull-request.outputs.pullRequestNumber }} is not ready to be merged. This is probably due to merge conflicts: fix them in ${{ env.TEMPLATE_REPO }} or in each of ${{ env.TEMPLATE_REPO }}-[dataset] before trying again.") |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# testpoppy | ||
|
||
A repo for testing GitHub Actions workflows for the Nipoppy project. |