1
1
# SPDX-FileCopyrightText: 2025 DB Systel GmbH
2
2
#
3
3
# SPDX-License-Identifier: Apache-2.0
4
+
4
5
---
5
6
name : Auto-Format with Stylelint and Prettier on PR for "self-healing" PRs
6
7
@@ -24,25 +25,21 @@ jobs:
24
25
if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]]; then
25
26
echo "Stylelint update detected."
26
27
echo "stylelint_update=true" >> $GITHUB_ENV
27
- echo "stylelint_update=false" >> $GITHUB_ENV
28
28
else if [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]]; then
29
29
echo "Prettier update detected."
30
30
echo "prettier_update=true" >> $GITHUB_ENV
31
- echo "prettier_update=false" >> $GITHUB_ENV
32
31
else
33
32
echo "No Stylelint or prettier updates detected."
34
- echo "stylelint_update=false" >> $GITHUB_ENV
35
- echo "prettier_update=false" >> $GITHUB_ENV
36
33
fi
37
34
38
35
- name : Set up Node.js
39
- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
36
+ if : env.stylelint_update == 'true'
40
37
uses : actions/setup-node@v4
41
38
with :
42
39
node-version-file : " .nvmrc"
43
40
44
41
- name : Install dependencies
45
- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
42
+ if : env.stylelint_update == 'true'
46
43
run : |
47
44
npm ci
48
45
57
54
npx --no prettier . --write
58
55
59
56
- name : Commit changes if formatting is done
60
- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
57
+ if : env.stylelint_update == 'true'
61
58
run : |
62
59
git config --global user.name 'github-actions[bot]'
63
60
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
0 commit comments