forked from Tufin/oasdiff-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·33 lines (30 loc) · 1013 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
readonly base="$1"
readonly revision="$2"
readonly format="$3"
readonly breaking_only="$4"
readonly fail_on_diff="$5"
if [ "$breaking_only" = "true" ] && [ "$fail_on_diff" = "true" ]
then
echo "running breaking_only and fail_on_diff..."
output=$( oasdiff -breaking-only -fail-on-diff -format "$format" -base "$base" -revision "$revision" 2>&1 )
elif [ "$breaking_only" = "true" ]
then
echo "running breaking_only..."
output=$( oasdiff -breaking-only -format "$format" -base "$base" -revision "$revision" 2>&1 )
elif [ "$fail_on_diff" = "true" ]
then
echo "running fail_on_diff..."
output=$( oasdiff -fail-on-diff -format "$format" -base "$base" -revision "$revision" 2>&1 )
else
echo "running default..."
output=$( oasdiff -format "$format" -base "$base" -revision "$revision" 2>&1 )
fi
retVal=$?
echo -e "$output"
output="${output//$'\n'/''}"
output="${output//$'"'/"'"}"
echo "text<<EOF" >> $GITHUB_OUTPUT
echo "$output" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
exit $retVal