Skip to content

Commit 49ae729

Browse files
committed
GH Actions: always quote variables
... to satisfy shellcheck rule SC2086: "Double quote to prevent globbing and word splitting". Ref: https://www.shellcheck.net/wiki/SC2086
1 parent b3d58ca commit 49ae729

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

.github/workflows/quicktest.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
id: set_ini
4949
run: |
5050
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
51-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
51+
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
5252
else
53-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
53+
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
5454
fi
5555
5656
- name: Install PHP
@@ -87,20 +87,20 @@ jobs:
8787
- name: Grab PHPUnit version
8888
id: phpunit_version
8989
# yamllint disable-line rule:line-length
90-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
90+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
9191

9292
- name: Determine PHPUnit config file to use
9393
id: phpunit_config
9494
run: |
9595
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
96-
echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT
97-
echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT
96+
echo 'FILE=phpunit10.xml.dist' >> "$GITHUB_OUTPUT"
97+
echo 'EXTRA_ARGS=' >> "$GITHUB_OUTPUT"
9898
elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
99-
echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT
100-
echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT
99+
echo 'FILE=phpunit10.xml.dist' >> "$GITHUB_OUTPUT"
100+
echo 'EXTRA_ARGS=' >> "$GITHUB_OUTPUT"
101101
else
102-
echo 'FILE=phpunit.xml.dist' >> $GITHUB_OUTPUT
103-
echo 'EXTRA_ARGS= --repeat 2' >> $GITHUB_OUTPUT
102+
echo 'FILE=phpunit.xml.dist' >> "$GITHUB_OUTPUT"
103+
echo 'EXTRA_ARGS= --repeat 2' >> "$GITHUB_OUTPUT"
104104
fi
105105
106106
- name: Run the unit tests without caching

.github/workflows/test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ jobs:
159159
id: set_ini
160160
run: |
161161
if [[ "${{ matrix.phpcs_version }}" != "dev-master" && "${{ matrix.phpcs_version }}" != "4.0.x-dev" ]]; then
162-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
162+
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
163163
else
164-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
164+
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
165165
fi
166166
167167
- name: Install PHP
@@ -208,20 +208,20 @@ jobs:
208208
- name: Grab PHPUnit version
209209
id: phpunit_version
210210
# yamllint disable-line rule:line-length
211-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
211+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
212212

213213
- name: Determine PHPUnit config file to use
214214
id: phpunit_config
215215
run: |
216216
if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
217-
echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT
218-
echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT
217+
echo 'FILE=phpunit10.xml.dist' >> "$GITHUB_OUTPUT"
218+
echo 'EXTRA_ARGS=' >> "$GITHUB_OUTPUT"
219219
elif [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }}" == "true" ]; then
220-
echo 'FILE=phpunit10.xml.dist' >> $GITHUB_OUTPUT
221-
echo 'EXTRA_ARGS=' >> $GITHUB_OUTPUT
220+
echo 'FILE=phpunit10.xml.dist' >> "$GITHUB_OUTPUT"
221+
echo 'EXTRA_ARGS=' >> "$GITHUB_OUTPUT"
222222
else
223-
echo 'FILE=phpunit.xml.dist' >> $GITHUB_OUTPUT
224-
echo 'EXTRA_ARGS= --repeat 2' >> $GITHUB_OUTPUT
223+
echo 'FILE=phpunit.xml.dist' >> "$GITHUB_OUTPUT"
224+
echo 'EXTRA_ARGS= --repeat 2' >> "$GITHUB_OUTPUT"
225225
fi
226226
227227
- name: Run the unit tests without caching (non-risky)
@@ -295,9 +295,9 @@ jobs:
295295
id: set_ini
296296
run: |
297297
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
298-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> $GITHUB_OUTPUT
298+
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On' >> "$GITHUB_OUTPUT"
299299
else
300-
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> $GITHUB_OUTPUT
300+
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
301301
fi
302302
303303
- name: Install PHP
@@ -332,7 +332,7 @@ jobs:
332332
- name: Grab PHPUnit version
333333
id: phpunit_version
334334
# yamllint disable-line rule:line-length
335-
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
335+
run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
336336

337337
- name: "DEBUG: Show grabbed version"
338338
run: echo ${{ steps.phpunit_version.outputs.VERSION }}

.github/workflows/update-docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ jobs:
5252
REF: ${{ github.ref }}
5353
run: |
5454
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
55-
echo "BRANCH=$REF" >> $GITHUB_OUTPUT
55+
echo "BRANCH=$REF" >> "$GITHUB_OUTPUT"
5656
else
57-
echo 'BRANCH=${{ env.DEFAULT_BRANCH }}' >> $GITHUB_OUTPUT
57+
echo 'BRANCH=${{ env.DEFAULT_BRANCH }}' >> "$GITHUB_OUTPUT"
5858
fi
5959
6060
- name: Checkout code
@@ -86,9 +86,9 @@ jobs:
8686
# yamllint disable rule:line-length
8787
run: |
8888
if [[ "${{ github.event_name }}" == 'release' && "${{ github.ref_type }}" == 'published' && "$REF_NAME" == "${{ env.DEFAULT_BRANCH }}" ]]; then
89-
echo "LAST_TAG=$REF_NAME" >> $GITHUB_OUTPUT
89+
echo "LAST_TAG=$REF_NAME" >> "$GITHUB_OUTPUT"
9090
else # = Pushed tag.
91-
echo "LAST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
91+
echo "LAST_TAG=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
9292
fi
9393
# yamllint enable rule:line-length
9494

.github/workflows/update-phpcs-versionnr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
- name: Grab latest tag name from API response
4141
id: version
4242
run: |
43-
echo "TAG=${{ fromJson(steps.get_latest_release.outputs.data).tag_name }}" >> $GITHUB_OUTPUT
43+
echo "TAG=${{ fromJson(steps.get_latest_release.outputs.data).tag_name }}" >> "$GITHUB_OUTPUT"
4444
4545
- name: Show tag name found in API response
4646
run: "echo latest release: ${{ steps.version.outputs.TAG }}"
4747

4848
- name: Set branches to use
4949
id: branches
5050
run: |
51-
echo "BASE=develop" >> $GITHUB_OUTPUT
52-
echo "PR_BRANCH=feature/getversiontest-update-phpcs-version" >> $GITHUB_OUTPUT
51+
echo "BASE=develop" >> "$GITHUB_OUTPUT"
52+
echo "PR_BRANCH=feature/getversiontest-update-phpcs-version" >> "$GITHUB_OUTPUT"
5353
5454
- name: Checkout code
5555
uses: actions/checkout@v4

0 commit comments

Comments
 (0)