-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ability to fail on ERR and other fail-on statuses for breaking changes #43
Changes from 3 commits
6ddd3f7
d96dd2c
468ff61
436f539
c4ea527
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,13 +40,14 @@ Additional arguments: | |
| CLI | Action input | Default | | ||
|---------------------------|-------------------------|---------| | ||
| --fail-on WARN | fail-on-diff | true | | ||
| --fail-on | fail-on | '' | | ||
| --include-checks | include-checks | csv | | ||
| --include-path-params | include-path-params | false | | ||
| --deprecation-days-beta | deprecation-days-beta | 31 | | ||
| --deprecation-days-stable | deprecation-days-stable | 180 | | ||
| --exclude-elements | exclude-elements | '' | | ||
|
||
This action delivers a summary of breaking changes, accessible as a GitHub step output named `breaking`. | ||
This action delivers a summary of breaking changes, accessible as a GitHub step output named `breaking`. Note: `fail-on-diff` takes precedence over `fail-on` when `fail-on-diff` is `true`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets align with oasdiff by having only |
||
|
||
### Generate a changelog | ||
Copy and paste the following snippet into your build .yml file: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,21 @@ set -e | |
readonly base="$1" | ||
readonly revision="$2" | ||
readonly fail_on_diff="$3" | ||
readonly include_checks="$4" | ||
readonly include_path_params="$5" | ||
readonly deprecation_days_beta="$6" | ||
readonly deprecation_days_stable="$7" | ||
readonly exclude_elements="$8" | ||
readonly fail_on="$4" | ||
readonly include_checks="$5" | ||
readonly include_path_params="$6" | ||
readonly deprecation_days_beta="$7" | ||
readonly deprecation_days_stable="$8" | ||
readonly exclude_elements="$9" | ||
|
||
echo "running oasdiff breaking... base: $base, revision: $revision, fail_on_diff: $fail_on_diff, include_checks: $include_checks, include_path_params: $include_path_params, deprecation_days_beta: $deprecation_days_beta, deprecation_days_stable: $deprecation_days_stable, exclude_elements: $exclude_elements" | ||
echo "running oasdiff breaking... base: $base, revision: $revision, fail_on_diff: $fail_on_diff, fail_on: $fail_on, include_checks: $include_checks, include_path_params: $include_path_params, deprecation_days_beta: $deprecation_days_beta, deprecation_days_stable: $deprecation_days_stable, exclude_elements: $exclude_elements" | ||
|
||
# Build flags to pass in command | ||
flags="" | ||
if [ "$fail_on_diff" = "true" ]; then | ||
flags="${flags} --fail-on WARN" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @effoeffi For #43 (comment), the reason it was not removed was that it would be a breaking change itself if it was removed from the action. If someone relies on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@jgill-shipwell that is why we are creating a release, and you should rely on it to avoid any breaking changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @effoeffi Updated this |
||
elif [ -z "$fail_on" ]; then | ||
flags="${flags} --fail-on $fail_on" | ||
fi | ||
if [ "$include_path_params" = "true" ]; then | ||
flags="${flags} --include-path-params" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you are testing?
I suggest taking an example that there is warnings but not errors and set fail-on: ERR and it should not fail