Skip to content

Commit

Permalink
Better message log for the action
Browse files Browse the repository at this point in the history
  • Loading branch information
Hook25 committed Jul 30, 2024
1 parent 95df047 commit 40ec5c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ jobs:
# compare two jsons without comparing the order arrays but just
# the content of objects
echo "Difference of com.canonical.certification::sru-server"
echo
echo
echo "Difference of com.canonical.certification::sru-server (diff this_branch main)"
diff \
<(jq -S 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); (. | (post_recurse | arrays) |= sort)' "sru_server_testplan_this_branch.json") \
<(jq -S 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); (. | (post_recurse | arrays) |= sort)' "sru_server_testplan_main.json") | tee sru_server_diff.txt
Expand All @@ -70,14 +72,16 @@ jobs:
if [[ "$DESCRIPTION" == *"## WARNING: This modifies com.canonical.certification::sru-server"* ]]; then
echo "Warning is correcty posted in the description for sru-server"
else
echo "Missing warning for sru-server modification"
echo "Missing warning for sru modification in the description"
echo "Include the following in your description:"
echo " ## WARNING: This modifies com.canonical.certification::sru-server"
exit 1
fi
else
echo "No diff found"
fi
echo "Difference of com.canonical.certification::sru"
echo "Difference of com.canonical.certification::sru (diff this_branch main)"
diff \
<(jq -S 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); (. | (post_recurse | arrays) |= sort)' "sru_testplan_this_branch.json") \
<(jq -S 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); (. | (post_recurse | arrays) |= sort)' "sru_testplan_main.json") | tee sru_diff.txt
Expand Down

0 comments on commit 40ec5c3

Please sign in to comment.