-
Notifications
You must be signed in to change notification settings - Fork 51
35 lines (32 loc) · 949 Bytes
/
auto-lint-fix.yml
File metadata and controls
35 lines (32 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: auto fix lint
on:
pull_request:
branches:
- main
jobs:
fix-lint:
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GH_CLOUD_SDK_JS_ADMIN_WRITE_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
- name: Install dependencies
run: npm ci
- run: npm run lint:fix
- name: Commit Changes if needed
run: |
diff=`git diff`
if [ ! -z "$diff" ]; then
git config --global user.email "cloud-sdk-js@github.com"
git config --global user.name "cloud-sdk-js"
git commit -m "fix: Changes from lint" -a
git push
fi