Skip to content

Harden release workflow permissions and shell inputs - #4319

Merged
zanieb merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/port-uv-release-hardening
Aug 18, 2026
Merged

zanieb merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/port-uv-release-hardening

Conversation

@zaniebot

Copy link
Copy Markdown
Contributor

The release workflow grants contents: write by default and embeds release tags in shell commands. Restrict the default token, declare the read access needed by planning, building, and reusable workflows, and preserve the existing publishing permissions. Pass release values through environment variables and quoted argument arrays so they are treated as arguments rather than shell source.

Port of astral-sh/uv#19822.

@zanieb
zanieb marked this pull request as ready for review August 18, 2026 18:28
@AlexWaygood

Copy link
Copy Markdown
Member

Isn't this file generated by cargo-dist? Won't these edits just get overwritten the next time we regenerate it?

@zanieb

zanieb commented Aug 18, 2026

Copy link
Copy Markdown
Member

cargo-dist isn't really maintained anymore, in uv, we've decided we're just maintaining these ourselves now so we can iterate on security.

@zanieb

zanieb commented Aug 18, 2026

Copy link
Copy Markdown
Member

(this is noted in the linked uv pull request)

@AlexWaygood

Copy link
Copy Markdown
Member

I see... in that case maybe let's get rid of the comment at the top of the file saying the file is generated, and the note I added to AGENTS.md that says that agents shouldn't try to edit this file because it's generated. But I guess that can all be done separately.

@AlexWaygood

Copy link
Copy Markdown
Member

(don't feel like I'm a great reviewer for this one but I'm in favour!)

@zanieb

zanieb commented Aug 18, 2026

Copy link
Copy Markdown
Member

I think these are all safe because they're straight ports of uv changes that have been used in production for a bit.

I'll post those other changes you asked for separately

@zanieb
zanieb merged commit ec4806b into astral-sh:main Aug 18, 2026
17 checks passed
zanieb pushed a commit to astral-sh/uv that referenced this pull request Aug 18, 2026
The release workflow still describes itself as generated even though it
is maintained manually. Update its header to make that ownership clear
while preserving the `cargo-dist` attribution and license notice.

Follow-up to
[astral-sh/ty#4319](astral-sh/ty#4319 (comment)).

Co-authored-by: zaniebot <[email protected]>
AlexWaygood pushed a commit that referenced this pull request Oct 14, 2026
The release workflow is maintained manually, but its header and
`AGENTS.md` still describe it as generated, and
`.pre-commit-config.yaml` excludes it from linting. Update the header,
remove the obsolete guidance, and enable the regular workflow linters.
Register the Depot runner, account for `$/` references in `actionlint`,
and use the same reference for the signing workflow. Document trusted
secret inheritance and quote the release notes path and optional
prerelease flag safely. `cargo-dist` remains responsible for release
planning and artifact generation.

Follow-up to
[#4319](#4319 (comment)).

---------

Co-authored-by: zaniebot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants