在 CI 上运行 Prettier
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
GitHub Actions
要在 GitHub Actions 中为 Prettier 应用自动修复,请执行以下操作:
-
安装
autofix.ciGitHub 应用。 -
确保你的仓库中安装了 固定版本 的 Prettier。
-
创建
.github/workflows/prettier.yml文件,内容如下:.github/workflows/prettier.ymlname: autofix.cion:pull_request:push:permissions: {}jobs:prettier:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- uses: actions/setup-node@v4- run: |yarnyarn prettier . --write- uses: autofix-ci/action@v1with:commit-message: "Apply Prettier format"
更多信息请参见 autofix.ci 网站。