diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a75bc641..42e9a77a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -35,27 +35,8 @@ jobs: - id: lint name: Lint code - run: npm run lint + run: npm run lint:check - id: format name: Format code - run: npm run format - - - id: get_branch_name - name: Get branch name - run: echo "branch_name=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV - - - id: checkout_branch - name: Checkout to branch - run: git checkout ${{ env.branch_name }} - - - id: commit_and_push - name: Commit and push formatted code - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git add . - git commit --allow-empty -m "lint and format" - git push origin HEAD:${{ env.branch_name }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npm run format:check diff --git a/package.json b/package.json index ddcde15f..0d7fd42a 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "start": "storybook dev -p 3000", "new": "node ./bin/newComponent/index.cjs", "lint": "eslint --fix", + "lint:check": "eslint", "format": "prettier . --write", + "format:check": "prettier . --check", "build:package": "node ./bin/buildPackage/index.js && publint", "build:chromatic": "storybook build -o docs", "build:docs": "storybook build -o docs && touch ./docs/.nojekyll",