From 337871991f584d349de9f0d9b42adeee0f9966f1 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Tue, 5 Dec 2023 20:23:27 +0700 Subject: [PATCH 1/3] Create Pull Request --- .github/workflows/optimize_svgs.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/optimize_svgs.yml b/.github/workflows/optimize_svgs.yml index a19d2d3d388..4dc797e81fd 100644 --- a/.github/workflows/optimize_svgs.yml +++ b/.github/workflows/optimize_svgs.yml @@ -19,7 +19,14 @@ jobs: uses: ericcornelissen/svgo-action@v4 id: svgo - name: Commit optimizations - uses: stefanzweifel/git-auto-commit-action@v5 + uses: EndBug/add-and-commit@v9 if: ${{steps.svgo.outputs.DID_OPTIMIZE}} with: + push: false commit_message: Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s) + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + title: "Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s)" + branch: "svg-optimization" + base: "develop" From 9896ff1905f83fe479918adb150fd757454d7251 Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Tue, 5 Dec 2023 20:30:32 +0700 Subject: [PATCH 2/3] Use easier name to catch in automerge --- .github/workflows/optimize_svgs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/optimize_svgs.yml b/.github/workflows/optimize_svgs.yml index 4dc797e81fd..fb1a7417323 100644 --- a/.github/workflows/optimize_svgs.yml +++ b/.github/workflows/optimize_svgs.yml @@ -27,6 +27,6 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - title: "Optimize ${{steps.svgo.outputs.OPTIMIZED_COUNT}} SVG(s)" + title: "Optimize SVG(s)" branch: "svg-optimization" base: "develop" From daef4a99648e80173f63c25990901385db73124d Mon Sep 17 00:00:00 2001 From: Pun Butrach Date: Tue, 5 Dec 2023 20:31:20 +0700 Subject: [PATCH 3/3] Initial Auto-merger --- .github/workflows/automerge.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000000..c0099f02758 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,15 @@ +name: Auto-merger + +on: + pull_request: + +jobs: + optimize-auto-merge: + runs-on: ubuntu-latest + if: github.event.pull_request.title == 'Optimize SVG(s)' + steps: + - env: + PR_URL: ${{ github.event.pull_request.html_url }} + run: | + gh pr comment $PR_URL --body "No issues found, auto-merging the pull request." + gh pr merge $PR_URL --auto --squash --delete-branch