-
Notifications
You must be signed in to change notification settings - Fork 26
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
1 changed file
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This workflow tries to keep this repo in sync with upstream commits. | ||
# It creates a pull request merging upstream into this repo. | ||
# If the tests pass then the PR is automatically merged by GitHub. | ||
name: Sync upstream | ||
env: | ||
UPSTREAM: pmret/papermario # If you forked dx, change this to star-haven/papermario-dx! | ||
UPSTREAM_BRANCH: main | ||
BASE_BRANCH: main | ||
on: | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: | ||
- webhook # 'push' event on upstream | ||
schedule: | ||
- cron: 0 0 * * * | ||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ env.BASE_BRANCH }} | ||
- name: Fetch upstream | ||
run: git fetch https://github.com/${{ env.UPSTREAM }}.git ${UPSTREAM_BRANCH} | ||
- name: Merge upstream | ||
run: | | ||
git checkout ${BASE_BRANCH} | ||
git merge --no-ff --log FETCH_HEAD -m "Merge upstream changes" | ||
- name: Push changes | ||
run: git push origin ${BASE_BRANCH} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Pull Request | ||
run: | | ||
gh pr create --title "Sync with ${{ env.UPSTREAM }}" --body "Automated PR to keep this repository in sync with upstream. Beep boop." --base ${BASE_BRANCH} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|