Skip to content

Make release script more robust and send user agent - #577

Merged
Freax13 merged 1 commit into
mainfrom
fix-release-scrip
Jul 27, 2026
Merged

Make release script more robust and send user agent#577
Freax13 merged 1 commit into
mainfrom
fix-release-scrip

Conversation

@phil-opp

@phil-opp phil-opp commented Jul 27, 2026

Copy link
Copy Markdown
Member

The data access policy of crates.io requires a user-agent header that identifies the application. Otherwise it may block the request. See https://crates.io/data-access for details.

This commit adds the required user-agent header and also fixes a related bug that misclassified the error response as 'release does not exist yet'. We now only create a new release if we're sure that the release does not exist yet. Errors are raised and fail the CI job so that we can investigate them.


Discovered in https://github.com/rust-osdev/bootloader/actions/runs/30249893235/job/89925267279

gh: Validation Failed (HTTP 422)
{"message":"Validation Failed","errors":[{"resource":"Release","code":"already_exists","field":"tag_name"}],"documentation_url":"https://docs.github.com/rest/releases/releases#create-a-release","status":"422"}Detected crate version 0.11.16
Could not find version 0.11.16 on crates.io; creating a new release

The API returned an error here and the script misclassified it as 'no release exists' and tried to publish.

The data access policy of crates.io requires a `user-agent` header that identifies the application. Otherwise it may block the request, which we saw in previous runs. See https://crates.io/data-access for details.

This commit adds the required user-agent header and also fixes a related bug that misclassified the error response as 'release does not exist yet'. We now only create a new release if we're sure that the release does not exist yet. Errors are raised and fail the CI job so that we can investigate them.

@Freax13 Freax13 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@Freax13
Freax13 merged commit 610301b into main Jul 27, 2026
18 checks passed
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