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

[ci] sync template files #29

Merged
merged 1 commit into from
Dec 21, 2024
Merged
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
58 changes: 26 additions & 32 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,37 @@
name: Format

name: autofix.ci
on:
pull_request:
push:
branches: [main]
permissions:
contents: read

jobs:
format:
autofix:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: |
- recursive: false
args: [--frozen-lockfile]
- args: [--global, prettier, sort-package-json]
- uses: actions/setup-node@v4

- name: Setup PNPM
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Sort package.json
run: find . -name "package.json" -not -path "*/node_modules/*" -exec sort-package-json {} \;
- name: Format with Prettier
run: pnpm prettier --write .
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
commit-message: "[ci] format"
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: ci-format
delete-branch: true
title: "[ci] format"
body: "This PR was automatically created to sort package.json files in the repository using sort-package-json and to format the repository using prettier."
labels: 🤖 bot
assignees: trueberryless
draft: false

- name: Install Dependencies
run: pnpm i

- name: Run prettier
run: npx prettier --write .

# Optimize all PNGs with https://pngquant.org/
- run: sudo apt-get update && sudo apt-get install -y pngquant
- name: Run pngquant
run: |
shopt -s globstar
find . -name '*.png' -exec pngquant --ext .png --force 256 {} \;

- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
Loading