-
Notifications
You must be signed in to change notification settings - Fork 449
[ci] Merge ESLint and Prettier workflows with auto-fix for faster iteration #4638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ed3ec8c
[ci] Merge ESLint and Prettier workflows with auto-fix
snomiao f2a2849
chore(lint-and-format): remove final lint and format check steps to s…
snomiao c39cf21
Merge branch 'main' into sno-eslint-fix
snomiao 3134670
[chore] Improve lint-and-format workflow with final validation and en…
snomiao 476bd06
[fix] Update claude-pr-review.yml to reference new lint-and-format job
snomiao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Lint and Format | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches-ignore: [ wip/*, draft/*, temp/* ] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| lint-and-format: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout PR | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
christian-byrne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ref: ${{ github.head_ref }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 'lts/*' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run ESLint with auto-fix | ||
| run: npm run lint:fix | ||
|
|
||
| - name: Run Prettier with auto-format | ||
| run: npm run format | ||
snomiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Check for changes | ||
| id: verify-changed-files | ||
| run: | | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
christian-byrne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "changed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "changed=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Commit changes | ||
| if: steps.verify-changed-files.outputs.changed == 'true' | ||
| run: | | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "GitHub Action" | ||
| git add . | ||
| git commit -m "[auto-fix] Apply ESLint and Prettier fixes" | ||
| git push | ||
|
|
||
| - name: Comment on PR | ||
| if: steps.verify-changed-files.outputs.changed == 'true' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: '✅ **Auto-fix Applied**\n\nESLint and Prettier have automatically fixed formatting and linting issues in this PR. The changes have been committed to this branch.' | ||
| }) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.