From 2d67023c57b3326159f9ff02b8f03e071b7b1411 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 2 Sep 2022 11:35:43 +0100 Subject: [PATCH 1/2] Add a triggerable workflow for running and commiting sync Not tested yet, but in principle the sync already works, as we have a job that runs a diff to disallow merging. So as long as the commit action works this should work. I wrote this as I am using mobile data and don't want to run it all locally... --- ...bstack.sync.yml => wbstack.sync.check.yml} | 0 .github/workflows/wbstack.sync.trigger.yml | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+) rename .github/workflows/{wbstack.sync.yml => wbstack.sync.check.yml} (100%) create mode 100644 .github/workflows/wbstack.sync.trigger.yml diff --git a/.github/workflows/wbstack.sync.yml b/.github/workflows/wbstack.sync.check.yml similarity index 100% rename from .github/workflows/wbstack.sync.yml rename to .github/workflows/wbstack.sync.check.yml diff --git a/.github/workflows/wbstack.sync.trigger.yml b/.github/workflows/wbstack.sync.trigger.yml new file mode 100644 index 000000000..dbcd51eb0 --- /dev/null +++ b/.github/workflows/wbstack.sync.trigger.yml @@ -0,0 +1,28 @@ +name: wbstack sync + +on: + workflow_dispatch: + inputs: + branch: + description: 'The branch name to run against' + required: true + default: 'not-main' + +jobs: + check_only_expected_sync_changes: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.0.2 + with: + ref: ${{ github.event.inputs.branch }} + - name: run sync + run: ./sync.sh + - name: Show `git diff`` output + run: git diff + - name: Make a commit + uses: EndBug/add-and-commit@v9 + with: + message: Run sync + committer_name: GitHub Actions + committer_email: 41898282+github-actions[bot]@users.noreply.github.com From f832dbb09174c361aa90048f1e3d2f64e176fd2c Mon Sep 17 00:00:00 2001 From: addshore Date: Tue, 6 Sep 2022 16:15:29 +0100 Subject: [PATCH 2/2] Switch to pull request creation --- .github/workflows/wbstack.sync.trigger.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wbstack.sync.trigger.yml b/.github/workflows/wbstack.sync.trigger.yml index dbcd51eb0..17e42dc22 100644 --- a/.github/workflows/wbstack.sync.trigger.yml +++ b/.github/workflows/wbstack.sync.trigger.yml @@ -20,9 +20,13 @@ jobs: run: ./sync.sh - name: Show `git diff`` output run: git diff - - name: Make a commit - uses: EndBug/add-and-commit@v9 + # For this action to work you must explicitly allow GitHub Actions to create pull requests. + # This setting can be found in a repository's settings under Actions > General > Workflow permissions. + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 with: - message: Run sync - committer_name: GitHub Actions - committer_email: 41898282+github-actions[bot]@users.noreply.github.com + title: wbstack sync for branch ${{ github.event.inputs.branch }} + commit-message: wbstack sync + branch: wbstack-sync/${{ github.event.inputs.branch }} + assignees: ${{ github.actor }} + delete-branch: true