11# SPDX-FileCopyrightText: 2025 DB Systel GmbH
22#
33# SPDX-License-Identifier: Apache-2.0
4+
45---
56name : Auto-Format with Stylelint and Prettier on PR for "self-healing" PRs
67
@@ -24,25 +25,21 @@ jobs:
2425 if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]]; then
2526 echo "Stylelint update detected."
2627 echo "stylelint_update=true" >> $GITHUB_ENV
27- echo "stylelint_update=false" >> $GITHUB_ENV
2828 else if [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]]; then
2929 echo "Prettier update detected."
3030 echo "prettier_update=true" >> $GITHUB_ENV
31- echo "prettier_update=false" >> $GITHUB_ENV
3231 else
3332 echo "No Stylelint or prettier updates detected."
34- echo "stylelint_update=false" >> $GITHUB_ENV
35- echo "prettier_update=false" >> $GITHUB_ENV
3633 fi
3734
3835 - name : Set up Node.js
39- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
36+ if : env.stylelint_update == 'true'
4037 uses : actions/setup-node@v4
4138 with :
4239 node-version-file : " .nvmrc"
4340
4441 - name : Install dependencies
45- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
42+ if : env.stylelint_update == 'true'
4643 run : |
4744 npm ci
4845
5754 npx --no prettier . --write
5855
5956 - name : Commit changes if formatting is done
60- if : env.stylelint_update == 'true' || env.prettier_update == 'true'
57+ if : env.stylelint_update == 'true'
6158 run : |
6259 git config --global user.name 'github-actions[bot]'
6360 git config --global user.email 'github-actions[bot]@users.noreply.github.com'
0 commit comments