Repository navigation
148 lines (123 loc) · 4.88 KB
/
Copy pathextract-identifiers.yml
File metadata and controls
148 lines (123 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Extract identifiers"
on:
workflow_dispatch:
push:
branches:
- "2.2.x"
paths:
- '.github/workflows/extract-identifiers.yml'
- 'identifier-extractor/**'
- '.phar-checksum'
concurrency:
group: extract-identifiers-${{ github.ref }} # will be canceled on subsequent pushes
cancel-in-progress: true
permissions:
contents: read
jobs:
extract:
name: "Extract identifiers"
runs-on: "ubuntu-latest"
strategy:
matrix:
repository:
- "phpstan/phpstan-src"
- "phpstan/phpstan-strict-rules"
- "phpstan/phpstan-deprecation-rules"
- "phpstan/phpstan-doctrine"
- "phpstan/phpstan-symfony"
- "phpstan/phpstan-phpunit"
- "phpstan/phpstan-nette"
- "phpstan/phpstan-dibi"
#- "phpstan/phpstan-php-parser"
- "phpstan/phpstan-beberlei-assert"
- "phpstan/phpstan-webmozart-assert"
- "phpstan/phpstan-mockery"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: ${{ matrix.repository }}
path: "identifier-extractor/repo"
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.1"
- name: "Install Extractor dependencies"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "identifier-extractor"
- name: "Repository name"
id: repo-name
run: echo "name=$(basename "${{ matrix.repository }}")" >> "$GITHUB_OUTPUT"
- name: "Branch name"
id: branch-name
working-directory: "identifier-extractor/repo"
run: echo "name=$(git branch --show)" >> "$GITHUB_OUTPUT"
- name: "Extract"
working-directory: "identifier-extractor/repo"
run: |
set -o pipefail
../../phpstan analyse -c ../extractor.neon -a ../vendor/autoload.php | tee ../${{ steps.repo-name.outputs.name }}.json
env:
REPO: ${{ matrix.repository }}
BRANCH: ${{ steps.branch-name.outputs.name }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: identifiers-${{ steps.repo-name.outputs.name }}
path: identifier-extractor/${{ steps.repo-name.outputs.name }}.json
merge:
permissions:
contents: write # for stefanzweifel/git-auto-commit-action to push code in repo
name: "Merge and commit identifiers"
needs: extract
runs-on: "ubuntu-latest"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "8.1"
- name: "Install Extractor dependencies"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "identifier-extractor"
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: identifiers-*
path: identifier-extractor/tmp
- name: "Merge"
working-directory: "identifier-extractor"
run: "php merge.php > ../website/src/errorsIdentifiers.json"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
with:
gpg_private_key: ${{ secrets.GPG_PHPSTANBOT_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PHPSTANBOT_KEY_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: "Commit changes"
uses: "stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403" # v5.2.0
id: "commit"
with:
commit_message: "Update errors identifiers"
commit_user_name: "phpstan-bot"
commit_user_email: "ondrej+phpstanbot@mirtes.cz"
commit_author: "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
commit_options: "--gpg-sign"