console/.github/workflows/prettier.yaml
renovate[bot] 16b0e13989
chore(deps): pin dependencies (#6627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-19 17:44:39 +02:00

52 lines
1.4 KiB
YAML

name: 'Prettier'
on:
workflow_dispatch:
inputs:
branch:
required: true
description: 'Name of the branch to run prettier'
run-name: 'Prettify "${{ github.event.inputs.branch }}" (by ${{ github.actor }})'
jobs:
prettier:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 2
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: setup environment
uses: ./.github/actions/setup
with:
actor: prettier
- name: Cache ESLint and Prettier
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
with:
path: |
.eslintcache
node_modules/.cache/prettier
key: lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
lint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: prettier
run: pnpm prettier
- name: push changes
shell: sh
run: |
changed=`git diff-index HEAD`
if [ -n "$changed" ]
then
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "Prettier"
git push
fi