Skip to content

fix: add pipefail to docs-check build step#1077

Merged
austingreco merged 1 commit intomainfrom
fix/docs-check-pipefail
Apr 9, 2026
Merged

fix: add pipefail to docs-check build step#1077
austingreco merged 1 commit intomainfrom
fix/docs-check-pipefail

Conversation

@austingreco
Copy link
Copy Markdown
Contributor

What type of PR is this?

  • New feature
  • Enhancement to existing feature
  • Bug fix
  • Documentation
  • Refactoring
  • Test
  • Other

What changed?

Added set -o pipefail to the Build step in docs-check.yml.

Why?

The build step pipes bun run build through tee to 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 means steps.build.outcome is 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:

  1. bun run build exits with code 1 (MDX compilation failure due to broken testing.md link)
  2. tee exits with code 0, masking the failure
  3. The "Annotate broken links" and "Fail if build failed" steps are skipped
  4. The job reports success

After this fix, set -o pipefail ensures the pipeline returns bun 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

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.
Copy link
Copy Markdown
Collaborator

@sallycr sallycr left a comment

Choose a reason for hiding this comment

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

looks good to me.

@austingreco austingreco merged commit e11bacc into main Apr 9, 2026
4 checks passed
@austingreco austingreco deleted the fix/docs-check-pipefail branch April 9, 2026 02:47
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.

3 participants