testing check format #5
Workflow file for this run
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: Format | |
on: [push] | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- run: npm ci | |
- name: Check Formatting | |
run: npm run format:check | |
- name: Fail if not formatted correctly | |
run: | | |
if [ $? -eq 0 ]; then | |
echo "Files are formatted correctly." | |
else | |
echo "Files are not formatted correctly. Please run 'prettier' to format your code." | |
exit 1 | |
fi |