Skip to content

Commit

Permalink
Another attempt to automate the prettier change (#5523)
Browse files Browse the repository at this point in the history
  • Loading branch information
ligi authored Jul 20, 2024
1 parent 7d2e8f2 commit f704042
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/prettier_write.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
name: Run prettier write
name: Apply prettier

on:
pull_request:
branches: [master]

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2
env:
PAT: ${{ secrets.PAT }}
with:
token: ${{ PAT }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/cache@v2
name: Configure npm caching
- name: Checkout
uses: actions/checkout@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/workflows/prettier.yml') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Run prettier
run: |-
npx prettier --write '_data/*/*.json'
- name: Commit changes
uses: EndBug/add-and-commit@v9
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Prettify code
uses: creyD/[email protected]
with:
message: 'Fix formatting'
prettier_options: --write _data/*/*.json
only_changed: True
name: Run prettier write

0 comments on commit f704042

Please sign in to comment.