Merge branch 'main' into kmC/content-script-architecture-ed9b #972
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: Bot Formatting | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| - master | |
| tags-ignore: | |
| - '**' | |
| concurrency: | |
| group: bot-format-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format: | |
| if: github.actor == 'cursor[bot]' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Cache node_modules | |
| id: cache-node-modules | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| node_modules | |
| injected/node_modules | |
| special-pages/node_modules | |
| messaging/node_modules | |
| types-generator/node_modules | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('.nvmrc') }}-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Run prettier --write | |
| continue-on-error: true | |
| run: npx prettier . --write | |
| - name: Run stylelint --fix | |
| continue-on-error: true | |
| run: npx stylelint "**/*.css" --fix | |
| - name: Commit and push formatting fixes | |
| env: | |
| TARGET_REF: ${{ github.ref }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -u | |
| git diff --cached --quiet || git commit -m "Auto-format: prettier + stylelint fix" | |
| git push origin "HEAD:$TARGET_REF" |