Modify entrypoint.sh to handle exit codes#63
Merged
effoeffi merged 3 commits intooasdiff:mainfrom Sep 23, 2025
Merged
Conversation
effoeffi
reviewed
Sep 20, 2025
effoeffi
approved these changes
Sep 23, 2025
|
|
||
| if [ -n "$output" ]; then | ||
| write_output "$output" | ||
| write_output "$output" |
Contributor
There was a problem hiding this comment.
Please remove the space at the end of the line
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.
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.