Fix check code format wf #284
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: check_code_format | |
# yamllint disable-line rule:truthy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
check_format_code: | |
name: check format code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: jiro4989/setup-nim-action@v2 | |
- name: Format code | |
run: | | |
git clean -f -x -d -e ".nim_runtime" | |
nim prettyfy | |
- name: Fail if needs reformatting | |
run: | | |
echo ".nim_runtime" > .gitignore | |
if [[ $(git status --porcelain) ]]; then | |
echo "please reformat/prettyfy these files:" | |
git status --porcelain=v1 | |
rm -vf .gitignore | |
exit 1 | |
fi | |
rm -vf .gitignore | |
... |