Skip to content

fix(release): stop referencing env context in environment: block - #26

Merged
Bre77 merged 2 commits into
mainfrom
fm/pts-release-workflow-fix
Aug 10, 2026
Merged

fix(release): stop referencing env context in environment: block#26
Bre77 merged 2 commits into
mainfrom
fm/pts-release-workflow-fix

Conversation

@Bre77

@Bre77 Bre77 commented Aug 10, 2026

Copy link
Copy Markdown
Member

Intent

  • Fix release.yml so it stops startup-failing on every push (zero jobs, Invalid workflow file at parse time) and can actually publish v0.10.1 to PyPI.
    • Root cause: jobs.publish-to-pypi.environment.name/url referenced ${{ env.ENVIRONMENT_NAME }} / ${{ env.PYPI_PROJECT_URL }}, but the environment: block's expression context doesn't resolve env (only github, inputs, vars, needs, secrets, strategy, matrix are valid there). GitHub rejected the whole file at parse time with Unrecognized named-value: 'env' - a startup failure that happens before trigger filtering applies, which is why it also fired (and failed) on plain branch pushes despite the on: block being tags-only.
    • Fix: use literal values for environment.name/url instead of the env indirection. env.PYTHON_VERSION elsewhere is untouched since run: steps do resolve env fine.
    • Added workflow_dispatch as a manual re-run trigger, so a tag whose run failed to publish (like v0.10.1 here) doesn't need tag surgery to retry.
    • Left the gate/publish job structure and the PEP 740 attestations setting (already enabled, matching ci(release): make release.yml the top-level publish workflow #22's reasoning) unchanged.

Bre77 added 2 commits August 10, 2026 13:26
jobs.<id>.environment.name/url only resolve github, inputs, vars,
needs, secrets, strategy, and matrix contexts - env isn't one of
them. GitHub Actions rejected the whole file at parse time
("Unrecognized named-value: 'env'"), which is a startup failure that
happens before trigger filtering, so it fired (and failed with zero
jobs) on every push, not just tag pushes.

Also add workflow_dispatch so a missed/failed tag publish can be
re-run manually without tag surgery.
@Bre77 Bre77 added the fm Opened by a Firstmate crewmate label Aug 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c836b32424

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

push:
tags:
- "v*.*.*"
workflow_dispatch:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restrict manual publishing to tag refs

When a maintainer dispatches this workflow from a branch admitted by the pypi environment, every job still runs: the branch artifact is published with an OIDC token, and gh release create later uses the branch name from github.ref_name. This bypasses the documented invariant that releases run only for v*.*.* tags and can publish an untagged commit or create a release named after a branch; guard manual runs with a tag-ref check or accept and validate an explicit release tag.

AGENTS.md reference: AGENTS.md:L17-L17

Useful? React with 👍 / 👎.

@Bre77
Bre77 merged commit 86314d4 into main Aug 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fm Opened by a Firstmate crewmate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant