feat: Merge PR features with test-IDs from Optimizecodecloudagents #8
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
| name: Auto Fix Code | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| auto-fix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: npm ci || npm install | |
| continue-on-error: true | |
| - name: Run ESLint Fix | |
| run: npx eslint . --fix --ext .ts,.tsx,.js,.jsx || true | |
| continue-on-error: true | |
| - name: Run Prettier Fix | |
| run: npx prettier --write "**/*.{ts,tsx,js,jsx,json,md,css,scss}" || true | |
| continue-on-error: true | |
| - name: Commit fixes | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add -A | |
| git diff --staged --quiet || git commit -m "style: auto-fix linting and formatting | |
| 🤖 Auto-fixed by GitHub Actions" | |
| git push || true | |