Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Pull Request #1627

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Auto-merger

on:
pull_request:

jobs:
optimize-auto-merge:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
optimize-auto-merge:
merge-optimize-svg:

runs-on: ubuntu-latest
if: github.event.pull_request.title == 'Optimize SVG(s)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking only for the title is not ideal

See https://github.com/LawnchairLauncher/lawnchair/blob/13-dev/.github/workflows/ci.yml#L109-L119 for a better implementation

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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a problem, because we would need to let it run a bit for the required check to complete then we can merge it.

9 changes: 8 additions & 1 deletion .github/workflows/optimize_svgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"