Skip to content

Commit

Permalink
fix: check if required commands are available
Browse files Browse the repository at this point in the history
maven build will not fail on local machines, but will fail during GitHub Actions build
  • Loading branch information
grigoriev committed Jun 27, 2024
1 parent 043614f commit 32add89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
run: cat /home/runner/.m2/settings.xml
- name: Build with Maven
run: mvn --batch-mode -DwpExporterImpl=docker clean package -P tests-with-weasyprint-docker
env:
FAIL_ON_CHECK_COMMANDS: 'true'
- name: Extract artefact version
id: artefact_version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
Expand Down
9 changes: 7 additions & 2 deletions .scripts/convert-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ function check_command() {
if ! command -v "$1" &> /dev/null; then
echo -e "\033[0;31m $1 is not installed! \033[0m" >&2
echo -e "\033[0;31m Help for About page will not be generated! \033[0m" >&2
exit 0

if [ -n "$FAIL_ON_CHECK_COMMANDS" ]; then
exit 1
else
exit 0
fi
fi
}

# Check if required commands are installed
check_command jq
check_command jq1
check_command curl
check_command awk

Expand Down

0 comments on commit 32add89

Please sign in to comment.