修复一些代码样式的问题 #2
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: Check-Code-Format | |
# This action works with pull requests and pushes on the main branch | |
on: | |
pull_request: | |
branches: [PR-Branch] | |
jobs: | |
prettier: | |
name: Prettier Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Prettier Check | |
id: "prettier-run" | |
uses: rutajdash/prettier-cli-action@v1.0.2 | |
with: | |
file_pattern: "**/*.{js,ts,mjs,vue,json,yml,md}" | |
config_path: "./prettier.config.mjs" | |
ignore_path: "./.prettierignore" | |
# This step only runs if prettier finds errors causing the previous step to fail | |
# This steps lists the files where errors were found | |
- name: Prettier Output | |
if: ${{ failure() }} | |
shell: bash | |
run: | | |
echo "The following files are not formatted:" | |
echo "${{steps.prettier-run.outputs.prettier_output}}" |