|
|
@@ -48,9 +48,21 @@ jobs:
|
|
|
- name: Install Node packages
|
|
|
run: npm ci --ignore-scripts
|
|
|
|
|
|
- - name: Run Prettier
|
|
|
+ - name: Check formatting
|
|
|
run: npx prettier --check .
|
|
|
|
|
|
+ - name: Apply formatting
|
|
|
+ if: github.event_name == 'pull_request'
|
|
|
+ run: npm run format
|
|
|
+
|
|
|
+ - name: Commit formatting changes
|
|
|
+ if: github.event_name == 'pull_request'
|
|
|
+ uses: EndBug/add-and-commit@v9
|
|
|
+ with:
|
|
|
+ default_author: github_actions
|
|
|
+ message: Apply Prettier formatting
|
|
|
+ add: "."
|
|
|
+
|
|
|
eslint:
|
|
|
name: ESLint
|
|
|
runs-on: ubuntu-latest
|