Fork Sync With Upstream #174
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
# .github/workflows/example.yml | |
name: Fork Sync With Upstream | |
on: | |
schedule: | |
# actually, ~5 minutes is the highest | |
# effective frequency you will get | |
- cron: '0 3 * * 1' | |
workflow_dispatch: #run manually | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: run a standard checkout action, provided by github | |
- name: Checkout main | |
uses: actions/[email protected] | |
with: | |
ref: master | |
fetch-depth: 0 | |
# submodules: 'recursive' ### may be needed in your situation | |
# Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch | |
- name: Sync-Fork-action | |
#uses: XueMoMo/[email protected] | |
uses: aormsby/[email protected] | |
with: | |
upstream_repository: pawelmalak/flame | |
upstream_branch: master | |
target_branch: master | |
#git_pull_rebase_config: true | |
# git_pull_args: --ff-only # optional arg use, defaults to simple 'pull' | |
# github_token: ${{ secrets.GITHUB_TOKEN }} # optional, for accessing repos that require authentication | |
# Step 3: Display a message if 'sync' step had new commits (simple test) | |
- name: Check for new commits | |
if: steps.sync.outputs.has_new_commits | |
run: echo "There were new commits." | |
# Step 4: Print a helpful timestamp for your records (not required, just nice) | |
- name: Timestamp | |
run: date |