Skip to content

Commit e73523d

Browse files
committed
PHAR - sign as PHPStan Bot
1 parent 42e33e6 commit e73523d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.github/workflows/create-tag.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: actions/checkout@v3
2525
with:
2626
fetch-depth: 0
27-
token: ${{ secrets.PAT }}
27+
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
2828

2929
- name: 'Get Previous tag'
3030
id: previoustag

.github/workflows/phar.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,23 @@ jobs:
147147
runs-on: "ubuntu-latest"
148148
timeout-minutes: 60
149149
steps:
150-
- name: "Configure GPG signing key"
151-
run: echo "$GPG_SIGNING_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
152-
env:
153-
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
150+
-
151+
name: Import GPG key
152+
id: import-gpg
153+
uses: crazy-max/ghaction-import-gpg@v5
154+
with:
155+
gpg_private_key: ${{ secrets.GPG_PHPSTANBOT_PRIVATE_KEY }}
156+
passphrase: ${{ secrets.GPG_PHPSTANBOT_KEY_PASSPHRASE }}
157+
git_config_global: true
158+
git_user_signingkey: true
159+
git_commit_gpgsign: true
154160

155161
- name: "Checkout phpstan-dist"
156162
uses: actions/checkout@v3
157163
with:
158164
repository: phpstan/phpstan
159165
path: phpstan-dist
160-
token: ${{ secrets.PAT }}
166+
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
161167
ref: 1.10.x
162168

163169
- name: "Get previous pushed dist commit"
@@ -215,18 +221,12 @@ jobs:
215221
working-directory: phpstan-dist
216222
run: rm phpstan.phar.asc && gpg --command-fd 0 --pinentry-mode loopback -u "$GPG_ID" --batch --detach-sign --armor --output phpstan.phar.asc phpstan.phar
217223
env:
218-
GPG_ID: ${{ secrets.GPG_ID }}
224+
GPG_ID: ${{ steps.import-gpg.outputs.fingerprint }}
219225

220226
- name: "Verify PHAR"
221227
working-directory: phpstan-dist
222228
run: "gpg --verify phpstan.phar.asc"
223229

224-
- name: "Set Git signing key"
225-
working-directory: phpstan-dist
226-
run: git config user.signingkey "$GPG_ID"
227-
env:
228-
GPG_ID: ${{ secrets.GPG_ID }}
229-
230230
- name: "Install lucky_commit"
231231
uses: baptiste0928/cargo-install@v1
232232
with:
@@ -239,20 +239,20 @@ jobs:
239239
env:
240240
INPUT_LOG: ${{ steps.git-log.outputs.log }}
241241
run: |
242-
git config --global user.name "Ondrej Mirtes"
243-
git config --global user.email "[email protected]"
242+
git config --global user.name "phpstan-bot"
243+
git config --global user.email "ondrej+phpstanbot@mirtes.cz"
244244
git add .
245-
git commit --gpg-sign -m "Updated PHPStan to commit ${{ github.event.after }}" -m "$INPUT_LOG" --author "Ondrej Mirtes <[email protected]>"
245+
git commit --gpg-sign -m "Updated PHPStan to commit ${{ github.event.after }}" -m "$INPUT_LOG" --author "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
246246
lucky_commit ${{ steps.short-src-sha.outputs.sha }}
247247
git push
248248
249249
- name: "Commit PHAR - tag"
250250
if: "startsWith(github.ref, 'refs/tags/')"
251251
uses: stefanzweifel/git-auto-commit-action@v4
252252
with:
253-
commit_user_name: "Ondrej Mirtes"
254-
commit_user_email: "[email protected]"
255-
commit_author: "Ondrej Mirtes <[email protected]>"
253+
commit_user_name: "phpstan-bot"
254+
commit_user_email: "ondrej+phpstanbot@mirtes.cz"
255+
commit_author: "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
256256
commit_options: "--gpg-sign"
257257
repository: phpstan-dist
258258
commit_message: "PHPStan ${{github.ref_name}}"

0 commit comments

Comments
 (0)