Skip to content

ci: Attach Vercel build logs to Slack post on failures - #1956

Open
marcleblanc2 wants to merge 4 commits into
mainfrom
ci-vercel-build-report-failed-event
Open

ci: Attach Vercel build logs to Slack post on failures#1956
marcleblanc2 wants to merge 4 commits into
mainfrom
ci-vercel-build-report-failed-event

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Fixing the GitHub action's filter to find the Vercel post in Slack, to attach the build logs in Slack instead of PRs on a public repo, just in case anything sensitive makes it way into the build, and out of the logs.

Follow-up to #1946, found by re-triggering the build on #1948 after merging #1946

Tested

Amp thread

…nd the Slack post by any text

Vercel sends vercel.deployment.failed (state.detail deployment_failed) for
a build that exits non-zero; vercel.deployment.error is only for deleted
deployments, so the workflow never ran on a real build failure.

fetch-log now also checks the deployment was built from COMMIT_SHA, since
the two arrive as separate inputs.

The Slack step could not find the Vercel app's post for b241772 even
though it was in the window; match on text, attachments and blocks without
requiring bot_id, and list the messages seen when giving up.

Amp-Thread-ID: https://ampcode.com/threads/T-01a093c3-a827-71ba-af20-c13e851c9a77
Co-authored-by: Amp <amp@ampcode.com>
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 12, 2026 4:51am UTC

Request Review

The post's top-level text is the commit title plus 'failed to deploy'; the
short SHA is only in a context block, which is why the SHA match missed.
The Inspect button URL ends in the deployment ID, which is also unique
per PR when two PRs share a commit.
@marcleblanc2 marcleblanc2 changed the title ci: Report Vercel build failures on the failed dispatch event, and find the Slack post by any text ci: Attach Vercel build logs to Slack post on failures Sep 12, 2026
The exact deployment ID match makes a wide window safe, and a re-run by
hand can come long after the post. Print the newest 20 messages seen when
giving up, to make the next miss easy to diagnose.
The repository is public, so nothing a build prints should land in a PR
comment or a workflow artifact. The log is attached as .txt to the Vercel
Slack post, so Slack renders it inline, and the PR comment links to that
reply (or to the channel when the upload did not happen).
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.

1 participant