chore: Update lint-js workflow to run Prettier and commit changes

Apply Prettier formatting to the codebase by running the Prettier command in the src/frontend directory. Also, add a step to commit the changes automatically using the git-auto-commit-action. This update improves code formatting and ensures consistency in the repository.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-19 09:47:31 -03:00
commit c22d7a4a7a

View file

@ -10,8 +10,10 @@ env:
jobs:
run-linters:
name: Run linters
name: Run Prettier
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
@ -38,16 +40,13 @@ jobs:
npm install
if: ${{ steps.setup-node.outputs.cache-hit != 'true' }}
- name: Run linters
uses: wearerequired/lint-action@v2
- name: Run Prettier
run: |
cd src/frontend
npm run format
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
github_token: ${{ secrets.github_token }}
auto_fix: true
git_email: "gabriel@langflow.org"
# Enable linters
# eslint: true
# eslint_auto_fix: true
prettier: true
prettier_auto_fix: true
prettier_args: '--write \"{tests,src}/**/*.{js,jsx,ts,tsx,json,md}\" --ignore-path .prettierignore'
commit_message: Apply Prettier formatting
branch: ${{ github.head_ref }}