Skip to content

Commit ae932d6

Browse files
committed
gh-workflow-ci: fix checking binary existence
use `type -p` instead of `hash -v` to check if a binary exists.
1 parent 4f12880 commit ae932d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/gh-workflow-ci.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# Helper script for GitHub Actions CI, used from e2e tests.
3-
set -eufo pipefail
3+
set -exufo pipefail
44

55
create_pac_github_app_secret() {
66
local app_private_key="${1}"
@@ -35,10 +35,10 @@ create_second_github_app_controller_on_ghe() {
3535
local test_github_second_private_key="${2}"
3636
local test_github_second_webhook_secret="${3}"
3737

38-
if hash -v apt >/dev/null 2>&1; then
38+
if [[ -n "$(type -p apt)" ]]; then
3939
apt update &&
4040
apt install -y python3-yaml
41-
elif hash -v dnf >/dev/null 2>&1; then
41+
elif [[ -n "$(type -p dnf)" ]]; then
4242
dnf install -y python3-pyyaml
4343
else
4444
# TODO(chmouel): setup a virtualenvironment instead

0 commit comments

Comments
 (0)