Skip to content

Upstream Sync

Upstream Sync #13

Workflow file for this run

name: Upstream Sync
permissions:
contents: write
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
sync_with_upstream:
name: Sync with Upstream
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork }}
steps:
- name: Checkout target repo
uses: actions/checkout@v4
- name: Sync Upstream
uses: aormsby/[email protected]
with:
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }}
upstream_sync_repo: apache/rocketmq
upstream_sync_branch: develop
target_sync_branch: develop
test_mode: false
- name: Check for Failure
if: failure()
run: |
echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork."
exit 1
# Step 3: Display a sample message based on the sync output var 'has_new_commits'
- name: New commits found
if: steps.sync.outputs.has_new_commits == 'true'
run: echo "New commits were found to sync."
- name: No new commits
if: steps.sync.outputs.has_new_commits == 'false'
run: echo "There were no new commits."
- name: Show value of 'has_new_commits'
run: echo ${{ steps.sync.outputs.has_new_commits }}