Skip to content

Commit b7d7637

Browse files
Copilotjeduden
andauthored
Refine release trigger workflow reuse
Agent-Logs-Url: https://github.com/jeduden/mdsmith/sessions/3f65518b-df4e-4054-9129-17a8e12b30a5 Co-authored-by: jeduden <1117699+jeduden@users.noreply.github.com>
1 parent bb9d9e8 commit b7d7637

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121

2222
jobs:
2323
build:
24-
if: >-
24+
if: &release_ref_ok >-
2525
github.event_name != 'create' ||
2626
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
2727
strategy:
@@ -79,7 +79,7 @@ jobs:
7979
# docs/development/release.md for why the `release` environment
8080
# gates them and what reviewer rules the maintainer should set
8181
# on it.
82-
if: >-
82+
if: &release_repo_ref_ok >-
8383
github.repository == 'jeduden/mdsmith' &&
8484
(github.event_name != 'create' ||
8585
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')))
@@ -197,10 +197,7 @@ jobs:
197197
# the operational checklist for npmjs.com / pypi.org / GitHub
198198
# environment configuration. Workflow comments here only record
199199
# the local intent of each setting.
200-
if: >-
201-
github.repository == 'jeduden/mdsmith' &&
202-
(github.event_name != 'create' ||
203-
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')))
200+
if: *release_repo_ref_ok
204201
environment: release
205202
# `id-token: write` lets `npm publish --provenance` mint an OIDC
206203
# token so the npm registry stamps each tarball with verifiable
@@ -276,10 +273,7 @@ jobs:
276273
# See docs/development/release.md for the canonical PyPI Trusted
277274
# Publisher config (workflow + environment scope) and the
278275
# operational checklist.
279-
if: >-
280-
github.repository == 'jeduden/mdsmith' &&
281-
(github.event_name != 'create' ||
282-
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')))
276+
if: *release_repo_ref_ok
283277
environment: release
284278
permissions:
285279
contents: read
@@ -321,10 +315,7 @@ jobs:
321315
runs-on: ubuntu-latest
322316
# See docs/development/release.md for the rationale on `if:`,
323317
# `environment:`, and the OIDC + attestations permission set.
324-
if: >-
325-
github.repository == 'jeduden/mdsmith' &&
326-
(github.event_name != 'create' ||
327-
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')))
318+
if: *release_repo_ref_ok
328319
environment: release
329320
permissions:
330321
contents: write
@@ -494,10 +485,7 @@ jobs:
494485
# GitHub Actions as the source.
495486
name: Deploy mdsmith.dev to GitHub Pages
496487
needs: [build]
497-
if: >-
498-
github.repository == 'jeduden/mdsmith' &&
499-
(github.event_name != 'create' ||
500-
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v')))
488+
if: *release_repo_ref_ok
501489
runs-on: ubuntu-latest
502490
permissions:
503491
contents: read

docs/development/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ not fire `release` workflows for draft creation. On
5555

5656
`release.yml` still omits `workflow_dispatch`,
5757
`pull_request_target`, `workflow_run`, and
58-
`release`. Those triggers could mint OIDC tokens or
58+
`release`. Those triggers can mint OIDC tokens or
5959
reach the PATs from a non-tag context. The `release`
6060
event would also still miss draft creation. When
6161
the run started from `create`, the final GitHub

0 commit comments

Comments
 (0)