Skip to content

Commit

Permalink
feat: add sync.yml which runs every month
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrafal authored Aug 20, 2024
1 parent c52a413 commit 0e9b021
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Sync branch to template

on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Sync branch to template
run: |
branch_name=$(git rev-parse --abbrev-ref HEAD)
original_remote=$(git remote get-url origin)
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git remote add template https://github.com/ubiquity/ts-template
git fetch template development
git update-index --assume-unchanged ".github/workflows/sync.yml"
git merge template/development --allow-unrelated-histories
git push "$original_remote" HEAD:"$branch_name"

0 comments on commit 0e9b021

Please sign in to comment.