Skip to content

Commit 7c87cea

Browse files
Replaced inline environment configuration with shell script for detecting package.json.
1 parent 67d3790 commit 7c87cea

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/code-style.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ jobs:
4343
runs-on: ubuntu-latest
4444

4545
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
46-
47-
env:
48-
HAS_PACKAGE_JSON: ${{ hashFiles('package.json') != '' && '1' || '0' }}
4946

5047
steps:
5148
- uses: actions/checkout@v5
@@ -55,6 +52,16 @@ jobs:
5552
with:
5653
node-version: 'latest'
5754

55+
- name: Detect package.json
56+
id: has_pkg
57+
shell: bash
58+
run: |
59+
if [ -f package.json ]; then
60+
echo "HAS_PACKAGE_JSON=1" >> "$GITHUB_ENV"
61+
else
62+
echo "HAS_PACKAGE_JSON=0" >> "$GITHUB_ENV"
63+
fi
64+
5865
- name: Setup Composer
5966
run: |
6067
composer global config --no-plugins allow-plugins.laravel/pint true

0 commit comments

Comments
 (0)