Skip to content

Commit 7aca84b

Browse files
committed
Merge remote-tracking branch 'origin/2.1.x' into 2.2.x
2 parents 1b1873c + b538b8f commit 7aca84b

File tree

9 files changed

+172
-19
lines changed

9 files changed

+172
-19
lines changed

.github/actionlint-matcher.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/actionlint.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
self-hosted-runner:
2+
# Labels of self-hosted runner in array of strings.
3+
labels:
4+
- blacksmith-4vcpu-ubuntu-2404
5+
6+
# Configuration variables in array of strings defined in your repository or
7+
# organization. `null` means disabling configuration variables check.
8+
# Empty array means no configuration variable is allowed.
9+
config-variables: null
10+
11+
# Configuration for file paths. The keys are glob patterns to match to file
12+
# paths relative to the repository root. The values are the configurations for
13+
# the file paths. Note that the path separator is always '/'.
14+
# The following configurations are available.
15+
#
16+
# "ignore" is an array of regular expression patterns. Matched error messages
17+
# are ignored. This is similar to the "-ignore" command line option.
18+
paths:
19+
.github/workflows/**/*.{yml,yaml}:
20+
# List of regular expressions to filter errors by the error messages.
21+
ignore:
22+
# Ignore the specific error from shellcheck
23+
- 'shellcheck reported issue in this script: SC2129:.+'

.github/workflows/backward-compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
composer global require --dev ondrejmirtes/backward-compatibility-check:^7.3.0.1
5252
5353
- name: "Check"
54-
run: "$(composer global config bin-dir --absolute)/roave-backward-compatibility-check"
54+
run: '"$(composer global config bin-dir --absolute)"/roave-backward-compatibility-check'

.github/workflows/issue-bot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
id: shards
6969
working-directory: "issue-bot"
7070
run: |
71-
echo "shards=$(jq -c '{include: [range(length) | {shard: .}]}' matrix.json)" >> $GITHUB_OUTPUT
71+
echo "shards=$(jq -c '{include: [range(length) | {shard: .}]}' matrix.json)" >> "$GITHUB_OUTPUT"
7272
7373
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7474
with:
@@ -210,7 +210,7 @@ jobs:
210210
./console.php evaluate > tmp/step-summary.md
211211
exit_code="$?"
212212
213-
cat tmp/step-summary.md >> $GITHUB_STEP_SUMMARY
213+
cat tmp/step-summary.md >> "$GITHUB_STEP_SUMMARY"
214214
215215
if [[ "$exit_code" == "2" ]]; then
216216
echo "::notice file=.github/workflows/issue-bot.yml,line=3 ::Issue bot detected open issues which are affected by this pull request - see https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
@@ -235,7 +235,7 @@ jobs:
235235
PHPSTAN_SRC_COMMIT_AFTER: ${{ github.event.after }}
236236
run: |
237237
set +e
238-
./console.php evaluate --post-comments >> $GITHUB_STEP_SUMMARY
238+
./console.php evaluate --post-comments >> "$GITHUB_STEP_SUMMARY"
239239
exit_code="$?"
240240
241241
# its fine when issue-bot found affected issues
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Configuration from:
2+
# https://github.com/johnbillion/plugin-infrastructure/blob/571cba96190304963285181e2b928d941b9ec7c4/.github/workflows/reusable-workflow-lint.yml
3+
4+
name: Lint GitHub Actions workflows
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "2.1.x"
10+
11+
permissions: {}
12+
13+
jobs:
14+
actionlint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Harden the runner (Audit all outbound calls)
18+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
19+
with:
20+
egress-policy: audit
21+
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Check workflow files
24+
run: |
25+
echo "::add-matcher::.github/actionlint-matcher.json"
26+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
27+
./actionlint -color
28+
shell: bash
29+
30+
octoscan:
31+
name: Octoscan
32+
runs-on: ubuntu-latest
33+
permissions:
34+
security-events: write # Required for codeql-action/upload-sarif to upload SARIF files.
35+
timeout-minutes: 10
36+
steps:
37+
- name: Harden the runner (Audit all outbound calls)
38+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
39+
with:
40+
egress-policy: audit
41+
42+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
- name: Run octoscan
44+
id: octoscan
45+
uses: synacktiv/action-octoscan@6b1cf2343893dfb9e5f75652388bd2dc83f456b0 # v1.0.0
46+
with:
47+
filter_triggers: ''
48+
49+
- name: Upload SARIF file to GitHub
50+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
51+
with:
52+
sarif_file: "${{steps.octoscan.outputs.sarif_output}}"
53+
category: octoscan
54+
wait-for-processing: false
55+
56+
poutine:
57+
name: Poutine
58+
runs-on: ubuntu-latest
59+
permissions:
60+
security-events: write # Required for codeql-action/upload-sarif to upload SARIF files.
61+
steps:
62+
- name: Harden the runner (Audit all outbound calls)
63+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
64+
with:
65+
egress-policy: audit
66+
67+
- name: Checkout repository
68+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
69+
with:
70+
persist-credentials: false
71+
72+
- name: Run Poutine
73+
uses: boostsecurityio/poutine-action@84c0a0d32e8d57ae12651222be1eb15351429228 # v0.15.2
74+
75+
- name: Upload poutine SARIF file
76+
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
77+
with:
78+
sarif_file: results.sarif
79+
category: poutine
80+
wait-for-processing: false
81+
82+
zizmor:
83+
name: Zizmor
84+
runs-on: ubuntu-latest
85+
permissions:
86+
security-events: write # Required for codeql-action/upload-sarif to upload SARIF files.
87+
steps:
88+
- name: Harden the runner (Audit all outbound calls)
89+
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
90+
with:
91+
egress-policy: audit
92+
93+
- name: Checkout repository
94+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95+
with:
96+
persist-credentials: false
97+
98+
- name: Install the latest version of uv
99+
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
100+
with:
101+
enable-cache: false
102+
103+
- name: Run zizmor
104+
run: uvx zizmor@1.20.0 --persona=auditor --format=sarif --strict-collection . > results.sarif
105+
env:
106+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
108+
- name: Upload SARIF file
109+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
110+
with:
111+
sarif_file: results.sarif
112+
category: zizmor
113+
wait-for-processing: false

.github/workflows/phar.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112

113113
- name: "Save checksum"
114114
id: "checksum"
115-
run: echo "md5=$(md5sum tmp/phpstan.phar | cut -d' ' -f1)" >> $GITHUB_OUTPUT
115+
run: echo "md5=$(md5sum tmp/phpstan.phar | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
116116

117117
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
118118
with:
@@ -231,7 +231,7 @@ jobs:
231231

232232
- name: "Save old checksum"
233233
id: "old_checksum"
234-
run: echo "md5=$(md5sum phpstan.phar | cut -d' ' -f1)" >> $GITHUB_OUTPUT
234+
run: echo "md5=$(md5sum phpstan.phar | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
235235

236236
- name: "Assert checksum"
237237
run: |
@@ -330,7 +330,7 @@ jobs:
330330
- name: "Get previous pushed dist commit"
331331
id: previous-commit
332332
working-directory: phpstan-dist
333-
run: echo "sha=$(sed -n '2p' .phar-checksum)" >> $GITHUB_OUTPUT
333+
run: echo "sha=$(sed -n '2p' .phar-checksum)" >> "$GITHUB_OUTPUT"
334334

335335
- name: "Checkout phpstan-src"
336336
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
@@ -342,24 +342,24 @@ jobs:
342342
id: git-log
343343
working-directory: phpstan-src
344344
run: |
345-
echo "log<<MESSAGE" >> $GITHUB_OUTPUT
346-
echo "$(git log ${{ steps.previous-commit.outputs.sha }}..${{ github.event.after }} --reverse --pretty='https://github.com/phpstan/phpstan-src/commit/%H %s')" >> $GITHUB_OUTPUT
347-
echo 'MESSAGE' >> $GITHUB_OUTPUT
345+
echo "log<<MESSAGE" >> "$GITHUB_OUTPUT"
346+
git log ${{ steps.previous-commit.outputs.sha }}..${{ github.event.after }} --reverse --pretty='https://github.com/phpstan/phpstan-src/commit/%H %s' >> "$GITHUB_OUTPUT"
347+
echo 'MESSAGE' >> "$GITHUB_OUTPUT"
348348
349349
- name: "Get short phpstan-src SHA"
350350
id: short-src-sha
351351
working-directory: phpstan-src
352-
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
352+
run: echo "sha=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT"
353353

354354
- name: "Check PHAR checksum"
355355
id: checksum-difference
356356
working-directory: phpstan-dist
357357
run: |
358-
checksum=${{needs.compiler-tests.outputs.checksum}}
358+
checksum="${{needs.compiler-tests.outputs.checksum}}"
359359
if [[ $(head -n 1 .phar-checksum) != "$checksum" ]]; then
360-
echo "result=different" >> $GITHUB_OUTPUT
360+
echo "result=different" >> "$GITHUB_OUTPUT"
361361
else
362-
echo "result=same" >> $GITHUB_OUTPUT
362+
echo "result=same" >> "$GITHUB_OUTPUT"
363363
fi
364364
365365
- name: "Download phpstan.phar"

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,6 @@ jobs:
185185

186186
- name: "Generate baseline"
187187
run: |
188-
> phpstan-baseline.neon && \
188+
true > phpstan-baseline.neon && \
189189
make phpstan-generate-baseline-php && \
190190
make phpstan-result-cache

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
172172

173173
- id: set-matrix
174-
run: echo "matrix=$(php .github/workflows/tests-levels-matrix.php)" >> $GITHUB_OUTPUT
174+
run: echo "matrix=$(php .github/workflows/tests-levels-matrix.php)" >> "$GITHUB_OUTPUT"
175175

176176
outputs:
177177
matrix: ${{ steps.set-matrix.outputs.matrix }}
@@ -325,12 +325,12 @@ jobs:
325325
--source-directory='build/PHPStan/Build' \
326326
--timeout=500 \
327327
> infection.json5
328-
cat infection.json5 | jq
328+
jq < infection.json5
329329
330330
- name: "Determine default branch"
331331
id: default-branch
332332
run: |
333-
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
333+
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> "$GITHUB_OUTPUT"
334334
335335
- name: "Restore result cache"
336336
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0

.github/workflows/update-phpstorm-stubs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
path: "phpstorm-stubs"
4040
repository: "jetbrains/phpstorm-stubs"
4141
- name: "Update stubs"
42-
run: "composer require jetbrains/phpstorm-stubs:dev-master#$(git -C phpstorm-stubs rev-parse HEAD)"
42+
run: "composer require \"jetbrains/phpstorm-stubs:dev-master#$(git -C phpstorm-stubs rev-parse HEAD)\""
4343
- name: "Remove stubs repo"
4444
run: "rm -r phpstorm-stubs"
4545
- name: "Update function metadata"

0 commit comments

Comments
 (0)