CommonJS interop #299
Workflow file for this run
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: Format code | |
| on: | |
| pull_request: | |
| branches: [main] | |
| # Right now we only want to run this on PRs to main. | |
| # The branch protection rules that we have in place prevent | |
| # it from running on direct pushes. | |
| # push: | |
| # branches: [main] | |
| jobs: | |
| format-code: | |
| name: Format code | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Install Prettier | |
| # Use global install to ensure Prettier is available | |
| # and that we don't modify the package.json | |
| run: | | |
| yarn add "prettier@$(cat ./package.json | jq -r '.devDependencies["prettier"]')" | |
| # Prettify code and commit if changes | |
| - name: Format code | |
| run: | | |
| yarn run format | |
| - name: Commit changes | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: Apply formatting changes | |
| branch: ${{ github.head_ref }} |