Docs: document how to use autofix.ci (#17215)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
fisker Cheungandautofix-ci[bot] authored and GitHub committed 2025-03-10 12:27:27 +08:00
1 parent eadb133b25
commit db0afb4472
5 files changed
+73 -5

No files matched your search

+1 -3
View File
@@ -3,9 +3,6 @@ name: autofix.ci # needed to securely identify the workflow
on:
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@@ -14,5 +11,6 @@ jobs:
fix:
name: Run automated fix
uses: prettier/shared-workflows/.github/workflows/automated-fix.yml@main
permissions: {}
with:
repository: prettier/prettier
+34
View File
@@ -0,0 +1,34 @@
---
id: ci
title: Run Prettier on CI
---
## GitHub Actions
To apply autofix for Prettier from GitHub Actions, do the following:
1. Install the [`autofix.ci`](https://github.com/apps/autofix-ci) GitHub App.
1. Make sure you have a **pinned** version of Prettier installed in your repository.
1. Create `.github/workflows/prettier.yml` with following content:
```yaml title=".github/workflows/prettier.yml"
name: autofix.ci
on:
pull_request:
push:
permissions: {}
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
yarn
yarn prettier . --write
- uses: autofix-ci/action@v1
with:
commit-message: "Apply Prettier format"
```
For more information see [autofix.ci](https://autofix.ci/) website.
+2 -1
View File
@@ -15,7 +15,8 @@
"plugins",
"cli",
"api",
"browser"
"browser",
"ci"
],
"Configuring Prettier": [
"options",
@@ -0,0 +1,34 @@
---
id: ci
title: Run Prettier on CI
---
## GitHub Actions
To apply autofix for Prettier from GitHub Actions, do the following:
1. Install the [`autofix.ci`](https://github.com/apps/autofix-ci) GitHub App.
1. Make sure you have a **pinned** version of Prettier installed in your repository.
1. Create `.github/workflows/prettier.yml` with following content:
```yaml title=".github/workflows/prettier.yml"
name: autofix.ci
on:
pull_request:
push:
permissions: {}
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- run: |
yarn
yarn prettier . --write
- uses: autofix-ci/action@v1
with:
commit-message: "Apply Prettier format"
```
For more information see [autofix.ci](https://autofix.ci/) website.
@@ -15,7 +15,8 @@
"plugins",
"cli",
"api",
"browser"
"browser",
"ci"
],
"Configuring Prettier": [
"options",