Repository navigation
Exit mix hex.info with status 2 when the package or release is missing - #1309
Merged
Merged
Conversation
Scripts that check whether a version is published, before publishing it, couldn't tell a missing release from a failed request because both exited with status 1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mix hex.info PACKAGE VERSIONexited with status 1 both when the release doesn't exist and when the request failed, for example on a 5xx or a network error. A script that publishes only when a version isn't on hex.pm yet had to parse theNo release with name ...message to tell the two apart. Exiting with status 1 in both cases was how hex_core's release workflow ended up publishing after a failed check (https://github.com/hexpm/hex_core/actions/runs/42227736305/job/127925415950).A 404 for the package or the release now exits with status 2. Every other error still exits with status 1, which is also what Mix exits with when the task itself fails, so a script can publish on 2 and fail on anything else. The status codes are documented in the task's moduledoc.