Skip to content

Commit 320dbd5

Browse files
emincihangeriM. Emin Cihangericloud-sdk-jsdavidkna-sap
authored
chore: Add the workflow for auto-lint-fix (#2345)
--------- Co-authored-by: M. Emin Cihangeri <m.emin.cihanger@sap.com> Co-authored-by: cloud-sdk-js <cloud-sdk-js@github.com> Co-authored-by: David Knaack <david.knaack@sap.com>
1 parent 049ef60 commit 320dbd5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: auto fix lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
9+
jobs:
10+
fix-lint:
11+
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
token: ${{ secrets.GH_CLOUD_SDK_JS_ADMIN_WRITE_TOKEN }}
20+
- name: Setup Node
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 20
24+
- name: Install dependencies
25+
run: npm ci
26+
- run: npm run lint:fix
27+
- name: Commit Changes if needed
28+
run: |
29+
diff=`git diff`
30+
if [ ! -z "$diff" ]; then
31+
git config --global user.email "cloud-sdk-js@github.com"
32+
git config --global user.name "cloud-sdk-js"
33+
git commit -m "fix: Changes from lint" -a
34+
git push
35+
fi

0 commit comments

Comments
 (0)