Skip to content

Feat/auto ci fmt

Feat/auto ci fmt #1680

Workflow file for this run

name: lint
on:
pull_request:
push:
branches:
- master
jobs:
linter:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install project dependencies
run: yarn install
- name: Lint
id: lint
run: yarn nx format:check --all
continue-on-error: true # Continue even if the check fails
- name: Check Lint Results
if: steps.lint.outcome == 'failure'
run: echo "lint_failed=true" >> $GITHUB_OUTPUT
- name: Auto-format and commit changes if needed
if: steps.lint.outcome == 'failure'
run: |
yarn nx format:write --all
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add .
git commit -m "Auto-format code" || echo "No changes to commit"
git push || echo "No changes to push"