-
Notifications
You must be signed in to change notification settings - Fork 57
33 lines (31 loc) · 991 Bytes
/
auto-lint.yml
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
name: auto-lint-fix
on:
pull_request: ~
jobs:
linting:
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GH_CLOUD_SDK_JS_ADMIN_WRITE_TOKEN }}
- run: git fetch --depth=1
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- name: Install Dependencies
run: yarn install --frozen-lockfile --ignore-engines
- name: Run Lint
run: yarn lint:fix
- name: Commit Changes if needed
run: |
diff=`git diff`
if [ ! -z "$diff" ]; then
git config --global user.email "[email protected]"
git config --global user.name "cloud-sdk-js"
git commit -m "Changes from lint:fix" -a
git push
fi