Skip to content

Conversation

@madkoo
Copy link
Contributor

@madkoo madkoo commented Sep 19, 2025

Changes Made
Exit code capture: Added exit_code=0 initialization and || exit_code=$? to capture the exit code from the oasdiff command without causing the script to exit immediately due to set -e.

Continued execution: Even if oasdiff returns a non-zero exit code (when differences are found with --fail-on-diff), the script continues to execute and properly handles the output.

Output handling: Restored the redirection to $GITHUB_OUTPUT for both the diff output and "No changes" cases to ensure the content goes into the multiline output format.

Proper delimiter closure: The closing delimiter is always written to complete the GitHub Actions multiline output format.

Exit with original code: The script exits with the original exit code from oasdiff, preserving the intended behavior where the action fails when differences are found and --fail-on-diff is true.

How This Fixes the Issue
The original problem was that when oasdiff found differences and returned exit code 1 (with --fail-on-diff enabled), the set -e directive caused the script to immediately terminate before:

Writing the diff output to $GITHUB_OUTPUT
Writing the closing delimiter
This left GitHub Actions with an incomplete multiline output format, causing the "invalid format delimiter not found before end of file" error.

@effoeffi effoeffi self-assigned this Sep 20, 2025
@madkoo madkoo requested a review from effoeffi September 21, 2025 08:06

if [ -n "$output" ]; then
write_output "$output"
write_output "$output"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the space at the end of the line

@effoeffi effoeffi merged commit c715fc9 into oasdiff:main Sep 23, 2025
10 checks passed
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.

2 participants