forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.35 KB
/
Copy pathformat.yml
File metadata and controls
36 lines (34 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Formatter
on:
pull_request:
branches:
- develop
jobs:
prettier:
# This conditional prevents running the job on PRs from forks; won't
# have permissions to commit changes, so the job would fail if it ran.
# PRs from forks will instead rely on failing the fmt_check job in test.yml
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.ref }}
# Must precede setup-node so its `cache: pnpm` can resolve the store path.
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: 'pnpm'
- name: Install dependencies
run: pnpm ci
# Workflows are not allowed to edit workflows. As result, we need to prevent Prettier from formatting them.
- name: Prevent workflows from being formatted
run: echo ".github" >> .prettierignore && cat .prettierignore
- run: pnpm run fmt
# Prevent the prettierignore change from being committed.
- run: git checkout .prettierignore
- uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # tag=v5
with:
commit_message: ':robot: Automated formatting fixes'