mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 22:47:17 +00:00
52 lines
1.4 KiB
YAML
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
|