CI: Allow to silence errors related to publish

This option allows to validate the Flatpak repo on pushes workflow.
This commit is contained in:
tytan652
2023-11-09 18:50:17 -03:00
committed by Georges Basile Stavracas Neto
parent 9f8655921f
commit fc79e813ea
2 changed files with 14 additions and 2 deletions
@@ -7,6 +7,10 @@ inputs:
path:
description: Path to flatpak-builder manifest or Flatpak build directory
required: true
validateToPublish:
description: If false, turns some errors to non-errors for non-publish workflow
required: false
default: true
workingDirectory:
description: Working directory to clone flatpak-builder-lint
required: false
@@ -65,9 +69,15 @@ runs:
done
n_errors=$(echo $ret | jq '.errors | length')
for ((i = 0; i < $n_errors; i++)); do
for ((i = 0 ; i < $(echo $ret | jq '.errors | length') ; i++)); do
error=$(echo $ret | jq ".errors[$i]")
echo "::error::$error found in the Flatpak ${{ inputs.artifact }}"
if [[ "${{ inputs.validateToPublish }}" == "false" && "${error//\"}" == "appstream-screenshots-not-mirrored" ]]; then
echo "::notice::$error found and ignored in the Flatpak ${{ inputs.artifact }}"
n_errors=$(($n_errors-1))
else
echo "::error::$error found in the Flatpak ${{ inputs.artifact }}"
fi
done
[[ $n_errors == 0 ]] || exit 2