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 diff --git a/.github/workflows/optimize_svgs.yml b/.github/workflows/optimize_svgs.yml index a19d2d3d388..fb1a7417323 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 SVG(s)" + branch: "svg-optimization" + base: "develop"