Skip to content

Commit 987ce02

Browse files
authored
Merge pull request #166 from PHPCSStandards/feature/ghactions-always-quote-vars
GH Actions: always quote variables
2 parents 6db82b0 + 5d581ec commit 987ce02

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.github/workflows/quicktest.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
id: set_ini
5555
run: |
5656
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
57-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
57+
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
5858
else
59-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
59+
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
6060
fi
6161
6262
- name: Install PHP
@@ -98,15 +98,15 @@ jobs:
9898

9999
- name: Grab PHPUnit version
100100
id: phpunit_version
101-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
101+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
102102

103103
- name: Determine PHPUnit composer script to use
104104
id: phpunit_script
105105
run: |
106106
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) || startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
107-
echo 'SUFFIX=' >> $GITHUB_OUTPUT
107+
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
108108
else
109-
echo 'SUFFIX=-lte9' >> $GITHUB_OUTPUT
109+
echo 'SUFFIX=-lte9' >> "$GITHUB_OUTPUT"
110110
fi
111111
112112
- name: Run the unit tests for the PHPCSDebug sniff

.github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ jobs:
9898
# On stable PHPCS versions, allow for PHP deprecation notices.
9999
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
100100
if [[ "${{ matrix.phpcs_version }}" != "dev-master" && "${{ matrix.phpcs_version }}" != "4.0.x-dev" ]]; then
101-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
101+
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
102102
else
103-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
103+
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
104104
fi
105105
106106
- name: Install PHP
@@ -152,15 +152,15 @@ jobs:
152152

153153
- name: Grab PHPUnit version
154154
id: phpunit_version
155-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
155+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
156156

157157
- name: Determine PHPUnit composer script to use
158158
id: phpunit_script
159159
run: |
160160
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) || startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
161-
echo 'SUFFIX=' >> $GITHUB_OUTPUT
161+
echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
162162
else
163-
echo 'SUFFIX=-lte9' >> $GITHUB_OUTPUT
163+
echo 'SUFFIX=-lte9' >> "$GITHUB_OUTPUT"
164164
fi
165165
166166
- name: Run the unit tests for the PHPCSDebug sniff

.github/workflows/update-website.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
REF: ${{ github.ref }}
4343
run: |
4444
if [ "${{ github.event_name }}" == "pull_request" ]; then
45-
echo "BRANCH=$REF" >> $GITHUB_OUTPUT
45+
echo "BRANCH=$REF" >> "$GITHUB_OUTPUT"
4646
else
47-
echo 'BRANCH=stable' >> $GITHUB_OUTPUT
47+
echo 'BRANCH=stable' >> "$GITHUB_OUTPUT"
4848
fi
4949
5050
- name: Checkout code
@@ -68,7 +68,7 @@ jobs:
6868
SHA: ${{ github.sha }}
6969
run: |
7070
shortsha=$(echo "$SHA" | cut -b 1-6)
71-
echo "SHORTSHA=$shortsha" >> $GITHUB_OUTPUT
71+
echo "SHORTSHA=$shortsha" >> "$GITHUB_OUTPUT"
7272
7373
- name: Prepare commit message
7474
id: commit_msg
@@ -77,9 +77,9 @@ jobs:
7777
COMMIT_MSG: ${{ github.event.head_commit.message }}
7878
run: |
7979
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref_type }}" == 'tag' ]]; then
80-
echo "MSG=Update website for release of version $REF_NAME" >> $GITHUB_OUTPUT
80+
echo "MSG=Update website for release of version $REF_NAME" >> "$GITHUB_OUTPUT"
8181
else
82-
echo "MSG=Sync website after commit (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> $GITHUB_OUTPUT
82+
echo "MSG=Sync website after commit (sha: ${{ steps.set_sha.outputs.SHORTSHA }})" >> "$GITHUB_OUTPUT"
8383
fi
8484
8585
- name: Check GitHub Pages status

0 commit comments

Comments
 (0)