Skip to content

Sync Changes from Template #2

Sync Changes from Template

Sync Changes from Template #2

name: Sync Changes from Template
on:
schedule:
# Run at 6:00 AM every sunday
- cron: "0 6 * * 0"
jobs:
sync-from-template:
# don't run this job on the template
if: github.repository != 'acm-ucr/hackathon-website'
name: Sync changes from acm-ucr/hackathon-website
runs-on: ubuntu-latest
steps:
- name: Checkout Current Repo
uses: actions/checkout@v3
with:
path: ${{ github.repository }}
- name: Checkout New Branch
working-directory: ${{ github.repository }}
run: |
current_date = $(date '+%m/%d/%Y')
git checkout -b sync-template-$current_date
- name: Fetch and Merge
working-directory: ${{ github.repository }}
run: |
git remote add template https://github.com/acm-ucr/hackathon-website
git fetch --all
git merge template/dev sync-template --allow-unrelated-histories
- name: Create New Pull Request
working-directory: ${{ github.repository }}
run: |
gh pr create --title "Sync Template Changes" --body "Syncing template changes from $(date +'%m-%d-%Y')"