From fae1cb91639a4d474b40eb4f38a2c175a2d53ba8 Mon Sep 17 00:00:00 2001 From: winston Date: Tue, 25 Jul 2023 08:23:03 +0200 Subject: [PATCH] ci(format): use `actionsx/prettier` --- .github/workflows/format.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 1587d17..479be77 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -12,12 +12,20 @@ jobs: steps: - uses: actions/checkout@v3 with: - token: ${{ secrets.USERSTYLES_TOKEN }} - # Make sure the actual branch is checked out when running on pull requests - ref: ${{ github.head_ref }} + # using the USERSTYLES_TOKEN for main (branch protection), + # and general github.token for PRs + token: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.USERSTYLES_TOKEN || github.token }}} - name: Run prettier - uses: creyD/prettier_action@v4.3 + uses: actionsx/prettier@v2 + with: + args: "--write styles/**/*.css" + + - name: Push Changes + uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ github.repository == 'catppuccin/userstyles' && github.ref == 'refs/heads/main' }} with: commit_message: "style: format code with prettier" - prettier_options: "--write styles/**/*.css" + commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + branch: ${{ github.ref }} +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json