Skip to content

Commit 87a0aee

Browse files
committed
GitHub Actions: Update config
1 parent 87cf158 commit 87a0aee

8 files changed

Lines changed: 88 additions & 57 deletions

File tree

.github/dependabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ updates:
44
- package-ecosystem: github-actions
55
directory: /
66
schedule:
7-
interval: weekly
7+
interval: daily
8+
cooldown:
9+
default-days: 3

.github/release-drafter.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Taken from https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enabling-automerge-on-a-pull-request
2+
# and https://github.com/dependabot/fetch-metadata/blob/06ea45a2e4582d87b11f03c7ce596ae3261f39f6/README.md?plain=1#L133-L160
13
name: Dependabot Auto-merge
24

35
on:
@@ -9,14 +11,25 @@ concurrency:
911
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
1012
cancel-in-progress: true
1113

12-
permissions: {}
14+
permissions:
15+
contents: write
16+
pull-requests: write
1317

1418
jobs:
15-
dependabot:
16-
permissions:
17-
contents: write
18-
pull-requests: write
19-
uses: typisttech/.github/.github/workflows/dependabot-auto-merge.yml@v3
20-
with:
21-
minor: true
22-
patch: true
19+
auto-merge-pull-request:
20+
runs-on: ubuntu-latest
21+
if: github.event.pull_request.user.login == 'dependabot[bot]'
22+
steps:
23+
- name: Dependabot metadata
24+
id: dependabot-metadata
25+
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
26+
with:
27+
github-token: "${{ secrets.GITHUB_TOKEN }}"
28+
29+
- if: |
30+
(steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor')
31+
|| (steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch')
32+
run: gh pr merge --auto --squash "$PR_URL"
33+
env:
34+
PR_URL: ${{github.event.pull_request.html_url}}
35+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/lint-actions.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Taken from https://github.com/typisttech/.github/blob/8c3b859e35165a6e81a660713be195ec61d2ca1d/.github/workflows/lint-actions.yml
2+
name: Lint GitHub Actions
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
workflow_call:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
actionlint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
23+
sparse-checkout: .github
24+
25+
- name: Check workflow files
26+
uses: docker://rhysd/actionlint:latest
27+
with:
28+
args: -color

.github/workflows/publish.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
name: Release Drafter
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches:
76
- main
7+
workflow_call:
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref_name }}
1111
cancel-in-progress: true
1212

13-
permissions: {}
14-
1513
jobs:
1614
release-drafter:
1715
runs-on: ubuntu-latest
1816
permissions:
1917
contents: write
2018
pull-requests: read
2119
steps:
22-
- uses: release-drafter/release-drafter@v6
23-
env:
24-
GITHUB_TOKEN: ${{ github.token }}
20+
- uses: release-drafter/release-drafter@563bf132657a13ded0b01fcb723c5a58cdd824e2 # v7.2.1

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- caret-7-3
4141
- exactly-7-3-5
4242
- complex
43-
verify-attestation:
43+
verify-attestation:
4444
- false
4545
include:
4646
- runs-on: ubuntu-24.04-arm
@@ -68,8 +68,9 @@ jobs:
6868
case: complex
6969
verify-attestation: true
7070
steps:
71-
- uses: actions/checkout@v6
71+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7272
with:
73+
persist-credentials: false
7374
path: local-action
7475

7576
- name: Create fake composer.json
@@ -100,8 +101,9 @@ jobs:
100101
outputs:
101102
runs-on: ubuntu-latest
102103
steps:
103-
- uses: actions/checkout@v6
104+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104105
with:
106+
persist-credentials: false
105107
path: local-action
106108

107109
- uses: ./local-action
@@ -147,8 +149,9 @@ jobs:
147149
- missing-php
148150
- missing-require
149151
steps:
150-
- uses: actions/checkout@v6
152+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
151153
with:
154+
persist-credentials: false
152155
path: local-action
153156

154157
- name: Create fake composer.json
@@ -169,16 +172,17 @@ jobs:
169172
runs-on: ubuntu-latest
170173
strategy:
171174
matrix:
172-
mode:
175+
mode:
173176
- minor-only
174177
- full
175178
source:
176179
- auto
177180
- php.net
178181
- offline
179182
steps:
180-
- uses: actions/checkout@v6
183+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
181184
with:
185+
persist-credentials: false
182186
path: local-action
183187

184188
- name: Ensure no composer.json

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
See [action.yml](action.yml) and the underlying script [`typisttech/php-matrix`](https://github.com/typisttech/php-matrix/#options).
3939

4040
```yaml
41-
- uses: typisttech/php-matrix-action@v2
41+
- uses: typisttech/php-matrix-action@ee26ae37ffb37246b9a3912b71d95b661ad341b8 # v2.0.8
4242
with:
4343
# Path to composer.json
4444
#
4545
# Default: composer.json
4646
composer-json: some/path/to/composer.json
47-
47+
4848
# Version format.
4949
#
5050
# Available modes:
@@ -68,9 +68,9 @@ See [action.yml](action.yml) and the underlying script [`typisttech/php-matrix`]
6868
source: offline
6969

7070
# PHP Matrix version.
71-
#
71+
#
7272
# The version of [php-matrix] to use. Leave blank for latest. For example: v1.0.2
73-
#
73+
#
7474
# [php-matrix]: https://github.com/typisttech/php-matrix
7575
#
7676
# Default: ''
@@ -124,12 +124,13 @@ jobs:
124124
outputs:
125125
versions: ${{ steps.php-matrix.outputs.versions }}
126126
steps:
127-
- uses: actions/checkout@v5
127+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
128128
with:
129129
sparse-checkout: composer.json
130130
sparse-checkout-cone-mode: false
131+
persist-credentials: false
131132
132-
- uses: typisttech/php-matrix-action@v2
133+
- uses: typisttech/php-matrix-action@ee26ae37ffb37246b9a3912b71d95b661ad341b8 # v2.0.8
133134
id: php-matrix
134135
135136
test:
@@ -139,8 +140,10 @@ jobs:
139140
matrix:
140141
php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
141142
steps:
142-
- uses: actions/checkout@v5
143-
- uses: shivammathur/setup-php@v2
143+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
144+
with:
145+
persist-credentials: false
146+
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
144147
with:
145148
php-version: ${{ matrix.php-version }}
146149
- run: composer install
@@ -161,12 +164,13 @@ jobs:
161164
test:
162165
runs-on: ubuntu-latest
163166
steps:
164-
- uses: actions/checkout@v5
165-
166-
- uses: typisttech/php-matrix-action@v2
167+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
168+
with:
169+
persist-credentials: false
170+
- uses: typisttech/php-matrix-action@ee26ae37ffb37246b9a3912b71d95b661ad341b8 # v2.0.8
167171
id: php-matrix
168172
169-
- uses: shivammathur/setup-php@v2
173+
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
170174
with:
171175
php-version: ${{ steps.php-matrix.outputs.highest }}
172176
@@ -192,12 +196,13 @@ jobs:
192196
highest: ${{ steps.php-matrix.outputs.highest }}
193197
lowest: ${{ steps.php-matrix.outputs.lowest }}
194198
steps:
195-
- uses: actions/checkout@v5
199+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
196200
with:
197201
sparse-checkout: composer.json
198202
sparse-checkout-cone-mode: false
203+
persist-credentials: false
199204
200-
- uses: typisttech/php-matrix-action@v2
205+
- uses: typisttech/php-matrix-action@ee26ae37ffb37246b9a3912b71d95b661ad341b8 # v2.0.8
201206
id: php-matrix
202207
203208
composer-audit:
@@ -215,18 +220,19 @@ jobs:
215220
env:
216221
COMPOSER_NO_AUDIT: 1
217222
steps:
218-
- uses: actions/checkout@v5
223+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
219224
with:
220225
sparse-checkout: |
221226
composer.json
222227
composer.lock
223228
sparse-checkout-cone-mode: false
229+
persist-credentials: false
224230
225-
- uses: shivammathur/setup-php@v2
231+
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # master
226232
with:
227233
php-version: ${{ matrix.php-version }}
228234
coverage: none
229-
- uses: ramsey/composer-install@v3
235+
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
230236
with:
231237
dependency-versions: ${{ matrix.dependency-versions }}
232238

0 commit comments

Comments
 (0)