Skip to content

Commit 2b227c2

Browse files
committed
[github-actions] Sparse-checkout workflow action source (#180)
1 parent fff01f4 commit 2b227c2

11 files changed

Lines changed: 145 additions & 84 deletions

.github/workflows/auto-assign.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ jobs:
3333
with:
3434
repository: php-fast-forward/dev-tools
3535
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
36-
path: .dev-tools-workflow-source
36+
path: .dev-tools-actions
37+
sparse-checkout: |
38+
.github/actions
3739
- id: resolve
38-
uses: ./.dev-tools-workflow-source/.github/actions/project-board/resolve
40+
uses: ./.dev-tools-actions/.github/actions/project-board/resolve
3941
with:
4042
project: ${{ inputs.project || vars.PROJECT || '' }}
4143

@@ -59,8 +61,10 @@ jobs:
5961
with:
6062
repository: php-fast-forward/dev-tools
6163
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
62-
path: .dev-tools-workflow-source
63-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/sync-status
64+
path: .dev-tools-actions
65+
sparse-checkout: |
66+
.github/actions
67+
- uses: ./.dev-tools-actions/.github/actions/project-board/sync-status
6468
with:
6569
organization: ${{ github.repository_owner }}
6670
project: ${{ needs.resolve-project.outputs.project_number }}
@@ -78,8 +82,10 @@ jobs:
7882
with:
7983
repository: php-fast-forward/dev-tools
8084
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
81-
path: .dev-tools-workflow-source
82-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/sync-linked-pr-metadata
85+
path: .dev-tools-actions
86+
sparse-checkout: |
87+
.github/actions
88+
- uses: ./.dev-tools-actions/.github/actions/project-board/sync-linked-pr-metadata
8389

8490
sync-pull-request-status:
8591
needs: resolve-project
@@ -96,19 +102,21 @@ jobs:
96102
with:
97103
repository: php-fast-forward/dev-tools
98104
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
99-
path: .dev-tools-workflow-source
105+
path: .dev-tools-actions
106+
sparse-checkout: |
107+
.github/actions
100108
- id: compute
101-
uses: ./.dev-tools-workflow-source/.github/actions/project-board/resolve-pr-status
109+
uses: ./.dev-tools-actions/.github/actions/project-board/resolve-pr-status
102110

103-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/sync-status
111+
- uses: ./.dev-tools-actions/.github/actions/project-board/sync-status
104112
with:
105113
organization: ${{ github.repository_owner }}
106114
project: ${{ needs.resolve-project.outputs.project_number }}
107115
resource-node-id: ${{ github.event.pull_request.node_id }}
108116
status-value: ${{ steps.compute.outputs.pull-request-status }}
109117

110118
- if: steps.compute.outputs.linked-issue-node-id != '' && steps.compute.outputs.linked-issue-status != ''
111-
uses: ./.dev-tools-workflow-source/.github/actions/project-board/sync-status
119+
uses: ./.dev-tools-actions/.github/actions/project-board/sync-status
112120
with:
113121
organization: ${{ github.repository_owner }}
114122
project: ${{ needs.resolve-project.outputs.project_number }}
@@ -126,11 +134,13 @@ jobs:
126134
with:
127135
repository: php-fast-forward/dev-tools
128136
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
129-
path: .dev-tools-workflow-source
137+
path: .dev-tools-actions
138+
sparse-checkout: |
139+
.github/actions
130140
- id: compute
131-
uses: ./.dev-tools-workflow-source/.github/actions/project-board/resolve-review-status
141+
uses: ./.dev-tools-actions/.github/actions/project-board/resolve-review-status
132142

133-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/sync-status
143+
- uses: ./.dev-tools-actions/.github/actions/project-board/sync-status
134144
with:
135145
organization: ${{ github.repository_owner }}
136146
project: ${{ needs.resolve-project.outputs.project_number }}

.github/workflows/changelog.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ jobs:
7676
with:
7777
repository: php-fast-forward/dev-tools
7878
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
79-
path: .dev-tools-workflow-source
79+
path: .dev-tools-actions
80+
sparse-checkout: |
81+
.github/actions
8082
8183
- name: Resolve workflow PHP version
8284
id: resolve
83-
uses: ./.dev-tools-workflow-source/.github/actions/php/resolve-version
85+
uses: ./.dev-tools-actions/.github/actions/php/resolve-version
8486

8587
validate_pull_request:
8688
name: Validate PR Changelog
@@ -100,10 +102,12 @@ jobs:
100102
with:
101103
repository: php-fast-forward/dev-tools
102104
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
103-
path: .dev-tools-workflow-source
105+
path: .dev-tools-actions
106+
sparse-checkout: |
107+
.github/actions
104108
105109
- name: Setup PHP and install dependencies
106-
uses: ./.dev-tools-workflow-source/.github/actions/php/setup-composer
110+
uses: ./.dev-tools-actions/.github/actions/php/setup-composer
107111
with:
108112
php-version: ${{ needs.resolve_php.outputs.php-version }}
109113
root-version: ${{ env.CHANGELOG_ROOT_VERSION }}
@@ -119,7 +123,7 @@ jobs:
119123
BASE_REF: ${{ github.event.pull_request.base.ref }}
120124
run: composer dev-tools changelog:check -- --file="${CHANGELOG_FILE}" --against="origin/${BASE_REF}"
121125

122-
- uses: ./.dev-tools-workflow-source/.github/actions/summary/write
126+
- uses: ./.dev-tools-actions/.github/actions/summary/write
123127
with:
124128
markdown: |
125129
## Changelog Validation Summary
@@ -149,18 +153,20 @@ jobs:
149153
with:
150154
repository: php-fast-forward/dev-tools
151155
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
152-
path: .dev-tools-workflow-source
156+
path: .dev-tools-actions
157+
sparse-checkout: |
158+
.github/actions
153159
154160
- name: Setup PHP and install dependencies
155-
uses: ./.dev-tools-workflow-source/.github/actions/php/setup-composer
161+
uses: ./.dev-tools-actions/.github/actions/php/setup-composer
156162
with:
157163
php-version: ${{ needs.resolve_php.outputs.php-version }}
158164
root-version: ${{ env.CHANGELOG_ROOT_VERSION }}
159165
install-options: --prefer-dist --no-progress --no-interaction --no-plugins --no-scripts
160166

161167
- name: Resolve release version
162168
id: version
163-
uses: ./.dev-tools-workflow-source/.github/actions/changelog/resolve-version
169+
uses: ./.dev-tools-actions/.github/actions/changelog/resolve-version
164170
with:
165171
changelog-file: ${{ env.CHANGELOG_FILE }}
166172
version: ${{ inputs.version || '' }}
@@ -173,7 +179,7 @@ jobs:
173179
composer dev-tools changelog:promote -- "${RELEASE_VERSION}" --file="${CHANGELOG_FILE}" --date="${release_date}"
174180
175181
- name: Render release notes preview
176-
uses: ./.dev-tools-workflow-source/.github/actions/changelog/render-release-notes
182+
uses: ./.dev-tools-actions/.github/actions/changelog/render-release-notes
177183
with:
178184
changelog-file: ${{ env.CHANGELOG_FILE }}
179185
version: ${{ steps.version.outputs.value }}
@@ -206,15 +212,17 @@ jobs:
206212
with:
207213
repository: php-fast-forward/dev-tools
208214
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
209-
path: .dev-tools-workflow-source
215+
path: .dev-tools-actions
216+
sparse-checkout: |
217+
.github/actions
210218
211-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/transition-status
219+
- uses: ./.dev-tools-actions/.github/actions/project-board/transition-status
212220
with:
213221
project: ${{ inputs.project || vars.PROJECT || '' }}
214222
from-status: Merged
215223
to-status: Release Prepared
216224

217-
- uses: ./.dev-tools-workflow-source/.github/actions/summary/write
225+
- uses: ./.dev-tools-actions/.github/actions/summary/write
218226
with:
219227
markdown: |
220228
## Release Preparation Summary
@@ -246,31 +254,33 @@ jobs:
246254
with:
247255
repository: php-fast-forward/dev-tools
248256
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
249-
path: .dev-tools-workflow-source
257+
path: .dev-tools-actions
258+
sparse-checkout: |
259+
.github/actions
250260
251261
- name: Setup PHP and install dependencies
252-
uses: ./.dev-tools-workflow-source/.github/actions/php/setup-composer
262+
uses: ./.dev-tools-actions/.github/actions/php/setup-composer
253263
with:
254264
php-version: ${{ needs.resolve_php.outputs.php-version }}
255265
root-version: ${{ env.CHANGELOG_ROOT_VERSION }}
256266
install-options: --prefer-dist --no-progress --no-interaction --no-plugins --no-scripts
257267

258268
- name: Resolve merged release version
259269
id: version
260-
uses: ./.dev-tools-workflow-source/.github/actions/changelog/resolve-merged-version
270+
uses: ./.dev-tools-actions/.github/actions/changelog/resolve-merged-version
261271
with:
262272
head-ref: ${{ github.event.pull_request.head.ref }}
263273
release-branch-prefix: ${{ env.RELEASE_BRANCH_PREFIX }}
264274

265275
- name: Render release notes
266-
uses: ./.dev-tools-workflow-source/.github/actions/changelog/render-release-notes
276+
uses: ./.dev-tools-actions/.github/actions/changelog/render-release-notes
267277
with:
268278
changelog-file: ${{ env.CHANGELOG_FILE }}
269279
version: ${{ steps.version.outputs.value }}
270280

271281
- name: Publish GitHub release
272282
id: publish_release
273-
uses: ./.dev-tools-workflow-source/.github/actions/changelog/publish-release
283+
uses: ./.dev-tools-actions/.github/actions/changelog/publish-release
274284
with:
275285
version: ${{ steps.version.outputs.value }}
276286
target: ${{ github.event.pull_request.merge_commit_sha || github.sha }}
@@ -281,16 +291,18 @@ jobs:
281291
with:
282292
repository: php-fast-forward/dev-tools
283293
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
284-
path: .dev-tools-workflow-source
294+
path: .dev-tools-actions
295+
sparse-checkout: |
296+
.github/actions
285297
286-
- uses: ./.dev-tools-workflow-source/.github/actions/project-board/transition-status
298+
- uses: ./.dev-tools-actions/.github/actions/project-board/transition-status
287299
with:
288300
project: ${{ inputs.project || vars.PROJECT || '' }}
289301
from-status: Release Prepared
290302
to-status: Released
291303
include-current-pull-request: 'true'
292304

293-
- uses: ./.dev-tools-workflow-source/.github/actions/summary/write
305+
- uses: ./.dev-tools-actions/.github/actions/summary/write
294306
with:
295307
markdown: |
296308
## Release Publication Summary

.github/workflows/label-sync.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
2929
with:
3030
repository: php-fast-forward/dev-tools
3131
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
32-
path: .dev-tools-workflow-source
32+
path: .dev-tools-actions
33+
sparse-checkout: |
34+
.github/actions
3335
3436
- name: Copy labels from issue to PR
35-
uses: ./.dev-tools-workflow-source/.github/actions/label-sync/copy-linked-issue-labels
37+
uses: ./.dev-tools-actions/.github/actions/label-sync/copy-linked-issue-labels

.github/workflows/reports.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ jobs:
4747
with:
4848
repository: php-fast-forward/dev-tools
4949
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
50-
path: .dev-tools-workflow-source
50+
path: .dev-tools-actions
51+
sparse-checkout: |
52+
.github/actions
5153
5254
- name: Resolve workflow PHP version
5355
id: resolve
54-
uses: ./.dev-tools-workflow-source/.github/actions/php/resolve-version
56+
uses: ./.dev-tools-actions/.github/actions/php/resolve-version
5557

5658
reports:
5759
needs: resolve_php
@@ -74,10 +76,12 @@ jobs:
7476
with:
7577
repository: php-fast-forward/dev-tools
7678
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
77-
path: .dev-tools-workflow-source
79+
path: .dev-tools-actions
80+
sparse-checkout: |
81+
.github/actions
7882
7983
- name: Setup PHP and install dependencies
80-
uses: ./.dev-tools-workflow-source/.github/actions/php/setup-composer
84+
uses: ./.dev-tools-actions/.github/actions/php/setup-composer
8185
with:
8286
php-version: ${{ needs.resolve_php.outputs.php-version }}
8387
extensions: pcov, pcntl
@@ -111,7 +115,7 @@ jobs:
111115

112116
- name: Copy existing previews into publish directory
113117
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
114-
uses: ./.dev-tools-workflow-source/.github/actions/github-pages/restore-previews
118+
uses: ./.dev-tools-actions/.github/actions/github-pages/restore-previews
115119
with:
116120
source: gh-pages-current
117121
target: ${{ env.REPORTS_TARGET }}
@@ -151,9 +155,11 @@ jobs:
151155
with:
152156
repository: php-fast-forward/dev-tools
153157
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
154-
path: .dev-tools-workflow-source
158+
path: .dev-tools-actions
159+
sparse-checkout: |
160+
.github/actions
155161
156-
- uses: ./.dev-tools-workflow-source/.github/actions/github-pages/verify-deployment
162+
- uses: ./.dev-tools-actions/.github/actions/github-pages/verify-deployment
157163
with:
158164
base-url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
159165
title: Reports health check failed
@@ -175,9 +181,11 @@ jobs:
175181
with:
176182
repository: php-fast-forward/dev-tools
177183
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
178-
path: .dev-tools-workflow-source
184+
path: .dev-tools-actions
185+
sparse-checkout: |
186+
.github/actions
179187
180-
- uses: ./.dev-tools-workflow-source/.github/actions/github-pages/verify-deployment
188+
- uses: ./.dev-tools-actions/.github/actions/github-pages/verify-deployment
181189
with:
182190
base-url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/previews/pr-${{ github.event.pull_request.number }}
183191
title: Preview health check failed
@@ -224,15 +232,17 @@ jobs:
224232
with:
225233
repository: php-fast-forward/dev-tools
226234
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
227-
path: .dev-tools-workflow-source
235+
path: .dev-tools-actions
236+
sparse-checkout: |
237+
.github/actions
228238
229239
- name: Checkout gh-pages
230240
uses: actions/checkout@v6
231241
with:
232242
ref: gh-pages
233243
path: gh-pages
234244

235-
- uses: ./.dev-tools-workflow-source/.github/actions/github-pages/remove-preview
245+
- uses: ./.dev-tools-actions/.github/actions/github-pages/remove-preview
236246
with:
237247
path: gh-pages
238248
pull-request-number: ${{ github.event.pull_request.number }}
@@ -261,15 +271,17 @@ jobs:
261271
with:
262272
repository: php-fast-forward/dev-tools
263273
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
264-
path: .dev-tools-workflow-source
274+
path: .dev-tools-actions
275+
sparse-checkout: |
276+
.github/actions
265277
266278
- name: Checkout gh-pages
267279
uses: actions/checkout@v6
268280
with:
269281
ref: gh-pages
270282
path: gh-pages
271283

272-
- uses: ./.dev-tools-workflow-source/.github/actions/github-pages/cleanup-orphaned-previews
284+
- uses: ./.dev-tools-actions/.github/actions/github-pages/cleanup-orphaned-previews
273285
id: cleanup
274286
with:
275287
path: gh-pages
@@ -297,7 +309,9 @@ jobs:
297309
with:
298310
repository: php-fast-forward/dev-tools
299311
ref: ${{ github.repository == 'php-fast-forward/dev-tools' && (github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha) || 'main' }}
300-
path: .dev-tools-workflow-source
312+
path: .dev-tools-actions
313+
sparse-checkout: |
314+
.github/actions
301315
302316
- id: build_summary
303317
env:
@@ -342,6 +356,6 @@ jobs:
342356
echo 'EOF'
343357
} >> "$GITHUB_OUTPUT"
344358
345-
- uses: ./.dev-tools-workflow-source/.github/actions/summary/write
359+
- uses: ./.dev-tools-actions/.github/actions/summary/write
346360
with:
347361
markdown: ${{ steps.build_summary.outputs.markdown }}

0 commit comments

Comments
 (0)