ci: 将静态分析命令添加至 lint-staged 配置文件 #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fix Code Style | |
on: | |
# 在针对 `main` 分支的推送上运行 | |
push: | |
branches: [main] | |
# 允许你从 Actions 选项卡手动运行此工作流程 | |
workflow_dispatch: | |
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列 | |
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成 | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.3] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: json, dom, curl, libxml, mbstring | |
coverage: none | |
- name: Install Pint | |
run: composer install -vvv | |
- name: Run Pint | |
run: composer format | |
- name: Commit linted files | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: 'Fixes coding style' |