Skip to content

Commit 3d84bbb

Browse files
committed
fix(ci): switch release trigger to push on main for PyPI environment compatibility
1 parent 91d3b7e commit 3d84bbb

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Release workflow.
2-
# Trigger model: only when a PR to main is closed and merged.
2+
# Trigger model: only on direct pushes to main (merge commits).
3+
# Using push instead of pull_request so the workflow runs under refs/heads/main,
4+
# which satisfies the PyPI environment deployment branch protection rule.
35
name: Release
46

57
on:
6-
pull_request:
7-
# Closed event is filtered below to merged-only.
8-
types: [closed]
8+
push:
99
branches: [main]
1010

1111
permissions:
@@ -27,8 +27,6 @@ jobs:
2727
permissions:
2828
# Needed for creating tags and GitHub releases.
2929
contents: write
30-
# Guard: run only for merged PRs.
31-
if: github.event.pull_request.merged == true
3230
outputs:
3331
changed: ${{ steps.version.outputs.changed }}
3432
version: ${{ steps.version.outputs.version }}
@@ -39,7 +37,6 @@ jobs:
3937
with:
4038
# Full history is required by semver-action to inspect commit history.
4139
fetch-depth: 0
42-
ref: ${{ github.event.pull_request.merge_commit_sha }}
4340

4441
- name: Compute semantic version from conventional commits
4542
id: semver
@@ -125,15 +122,14 @@ jobs:
125122
name: Build Package Artifacts
126123
runs-on: ubuntu-latest
127124
needs: release
128-
if: github.event.pull_request.merged == true && needs.release.outputs.changed == 'true'
125+
if: needs.release.outputs.changed == 'true'
129126

130127
steps:
131128
- name: Checkout
132129
uses: actions/checkout@v6
133130
with:
134131
# Full history and tags required by poetry-dynamic-versioning.
135132
fetch-depth: 0
136-
ref: ${{ github.event.pull_request.merge_commit_sha }}
137133

138134
- name: Install Poetry
139135
run: pipx install poetry
@@ -159,7 +155,7 @@ jobs:
159155
name: Publish to PyPI
160156
runs-on: ubuntu-latest
161157
needs: [release, build]
162-
if: github.event.pull_request.merged == true && needs.release.outputs.changed == 'true'
158+
if: needs.release.outputs.changed == 'true'
163159
environment: pypi
164160
permissions:
165161
# Required for OIDC trusted publishing.

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 1.3.1 - 2026-04-22
4+
5+
Release workflow and test isolation fixes.
6+
7+
### Fixed in 1.3.1
8+
9+
- Fixed release workflow trigger: switched from `pull_request: closed` to `push: branches: [main]` so the workflow runs under `refs/heads/main` and satisfies the PyPI environment deployment branch protection rule.
10+
- Fixed `build` job checkout missing `fetch-depth: 0`, required by `poetry-dynamic-versioning` to read git tags.
11+
- Fixed `download-artifact` version mismatch (`v5``v7`) to align with `upload-artifact@v7`.
12+
313
## 1.3.0 - 2026-04-22
414

515
DX, onboarding, and PyPI publishing release.
@@ -21,6 +31,10 @@ DX, onboarding, and PyPI publishing release.
2131
- Updated generated artifact metadata and aligned generation tests with current template output.
2232
- Added PyPI publish job to release workflow using OIDC trusted publishing (no API tokens required).
2333

34+
### Fixed in 1.3.0
35+
36+
- Fixed `test_install_and_verify_exits_zero` writing generated artifacts into the repository root instead of an isolated `tmp_path`.
37+
2438
## 1.2.5 - 2026-04-21
2539

2640
CI dependency maintenance release.

0 commit comments

Comments
 (0)