Skip to content

Commit

Permalink
Add github action to sync fork with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Sep 29, 2023
1 parent 5aaae1a commit 3c52316
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/sync_develop_with_upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Merge Trilinos/trilinos/develop into E3SM-Project/trilinos/develop

on:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch: # sync on button click

jobs:
merge-upstream-develop:

runs-on: ubuntu-latest

steps:
- name: Show action trigger
run: echo "The job was triggered by a ${{github.event_name}} event."
- name: Get current date
id: date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Check out the repository
uses: actions/checkout@v4
with:
show-progress: false
ref: develop
- name: Add upstream repo
run: git remote add upstream https://github.com/trilinos/trilinos
- name: Fetch upstream repo
run: git fetch upstream
- name: Create branch
run: git checkout -b update-develop-${{ steps.date.outputs.DATE }}
- name: debug
run: git remote -v
- name: debug2
run: pwd
- name: debug2
run: git branch -a | grep develop
- name: Merge upstream branch
run: git merge --ff-only upstream/develop
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
branch: update-develop-${{ steps.date.outputs.DATE }}
delete-branch: true
base: develop
title: Merge trilinos/develop into e3sm-project/develop
body: Created by Github action
- name: Merge Pull Request
uses: peter-evans/enable-pull-request-automerge
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}

0 comments on commit 3c52316

Please sign in to comment.