fix: add pipefail to docs-check build step#1077
Merged
austingreco merged 1 commit intomainfrom Apr 9, 2026
Merged
Conversation
The build step pipes `bun run build` through `tee` to capture output, but bash uses the exit code of the last pipeline command by default. Since `tee` always succeeds, the step never reports failure — making the broken-link check completely ineffective. Adding `set -o pipefail` ensures the pipeline returns the exit code of `bun run build`, so broken links are properly caught and annotated.
donovanlopez
approved these changes
Apr 8, 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.
What type of PR is this?
What changed?
Added
set -o pipefailto the Build step indocs-check.yml.Why?
The build step pipes
bun run buildthroughteeto capture output for the broken-link annotator. But bash's default behavior uses the exit code of the last command in a pipeline —tee, which always exits 0. This meanssteps.build.outcomeis never'failure', so the "Annotate broken links" and "Fail if build failed" steps are always skipped.The broken-link check has been completely ineffective since it was added. This was discovered while reviewing PRs #1035–#1040, all of which have broken links that CI should be catching.
How did you test it?
Confirmed via CI run logs on PR #1035 that:
bun run buildexits with code 1 (MDX compilation failure due to brokentesting.mdlink)teeexits with code 0, masking the failuresuccessAfter this fix,
set -o pipefailensures the pipeline returnsbun run build's exit code.Potential risks
Docs PRs with broken links that were previously passing CI will now correctly fail. PRs #1035–#1040 will need their broken links fixed before they can merge.
Release notes
N/A — CI-only change.
Documentation changes
N/A