feat(discord/build): validate ref before dispatching workflow#152
Merged
barnabasbusa merged 2 commits intomasterfrom Apr 21, 2026
Merged
feat(discord/build): validate ref before dispatching workflow#152barnabasbusa merged 2 commits intomasterfrom
barnabasbusa merged 2 commits intomasterfrom
Conversation
Clicking "Copy tag"/"Copy tags" now returns an ephemeral reply with each image tag in its own triple-backtick block, so Discord's per-block copy icon copies a single tag — no more duplicated link+block and no risk of grabbing every tag at once. The "Show another image…" dropdown is removed since all tags are visible in the reply.
Probe GitHub's repos/{owner}/{repo}/commits/{ref} endpoint right after
defaults are resolved and before the workflow is dispatched. On 404/422
the ephemeral reply is edited to "Build not dispatched — ref X not
found in owner/repo" and no workflow run is created. Transient probe
failures (network, rate limit, unexpected status) are logged and fall
through to dispatch so we don't regress reliability on the happy path.
mattevans
approved these changes
Apr 21, 2026
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.
Summary
GET /repos/{owner}/{repo}/commits/{ref}right after defaults are resolved and before the workflow is dispatched.c.httpClient+ token — no new dependencies. Capped at 5s so a hung probe can't starve the 15-minute deferred ack budget.Motivation
Complements ethpandaops/eth-client-docker-image-builder#355 (which fails fast in the
preparejob). Catching the same error one step earlier means the user sees the failure in their own ephemeral within ~100-300 ms — no workflow run queued, no click through to GitHub to figure out what went wrong.Test plan
/buildwith a valid repo + branch → build dispatches as before./buildwith a typo'd branch (e.g.ref: does-not-exist) → ephemeral shows "Build not dispatched — ref `does-not-exist` not found in …" and no run appears on GitHub./buildwith a valid commit SHA → dispatches (commits endpoint resolves SHAs)./buildwith a garbage SHA (e.g.deadbeefdeadbeef) → ephemeral not-found message./buildwith a nonexistentrepository→ ephemeral not-found message.refso the workflow default kicks in → validation still runs against the default and passes.