From 48c0b91bbe371a5e94660459be388f6a6bba4b88 Mon Sep 17 00:00:00 2001 From: Kyle Harding Date: Thu, 21 Sep 2023 16:17:36 -0400 Subject: [PATCH] Automatically sync commits from upstream Change-type: patch Signed-off-by: Kyle Harding --- .github/workflows/upstream-sync.yml | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/upstream-sync.yml diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml new file mode 100644 index 0000000000..fa944051d7 --- /dev/null +++ b/.github/workflows/upstream-sync.yml @@ -0,0 +1,54 @@ +name: "Upstream Sync" + +on: + schedule: + # at 07:00 every Monday and Thursday + - cron: "0 7 * * 1,4" + pull_request: + branches: + - master + - main + workflow_dispatch: + +jobs: + sync_branch: + runs-on: ubuntu-latest + name: Sync branch + + strategy: + matrix: + branch: + - dunfell + - honister + - kirkstone + - thud + - warrior + - pyro + - rocko + - sumo + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + # https://github.com/aormsby/Fork-Sync-With-Upstream-action + - name: Sync upstream commits + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: ${{ matrix.branch }} + target_repo_token: ${{ secrets.GITHUB_TOKEN }} + upstream_sync_branch: ${{ matrix.branch }} + host_domain: git.yoctoproject.org + upstream_sync_repo: git/poky + test_mode: ${{ github.event_name == 'pull_request' }} + + - name: New commits synced + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were synced." >> $GITHUB_STEP_SUMMARY + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." >> $GITHUB_STEP_SUMMARY