Skip to content

Conversation

@GrantBirki
Copy link
Contributor

@GrantBirki GrantBirki commented Aug 6, 2025

Use artifact-id instead of name with Actions Artifacts 🔒

This pull updates the publish workflow to use artifact-id instead of name when downloading artifacts that have been previously published in prior workflow steps. This is important because artifacts produced by GitHub Actions can be completely overwritten by other workflow runs if they use the same name under very unique circumstances (like passing the run-id value to the download-artifact action to point to an entirely different workflow run - don't do that). To avoid potential TOCTOU issues/vulnerabilities where an artifact might be replaced between upload and download, the new artifact-ids input allows you to download artifacts by their specific ID rather than by name. This is safer but also helps lead to more deterministic workflow builds by referencing the artifact you wish to download by its exact id.

This PR also hardens the workflow a bit by adding persist-credentials: false to the checkout step.


I recently did some work to land these exact changes in the urllib3/urllib3 and wanted to contribute those same changes here as well!

Added artifact-id output to publish workflow and updated download-artifact action version to `v5.0.0`. Also hardens the workflow a bit by adding `persist-credentials: false` to the checkout step
@sigmavirus24 sigmavirus24 merged commit 46e939b into psf:main Aug 6, 2025
29 checks passed
@sigmavirus24
Copy link
Contributor

🎉 Thank you!

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.

2 participants