diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fc28f318..ad090ae3 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,8 +62,8 @@ jobs: id: bridge_branch continue-on-error: true run: | - echo "refs/heads/${GITHUB_HEAD_REF}" - git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "refs/heads/${GITHUB_HEAD_REF}")" + echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")" - name: Start sg-bridge from container image if: steps.bridge_branch.outcome != 'success' run: | @@ -158,8 +158,8 @@ jobs: id: bridge_branch continue-on-error: true run: | - echo "refs/heads/${GITHUB_HEAD_REF}" - git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "refs/heads/${GITHUB_HEAD_REF}")" + echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")" - name: Start sg-bridge from container image if: steps.bridge_branch.outcome != 'success' run: | @@ -323,8 +323,8 @@ jobs: id: bridge_branch continue-on-error: true run: | - echo "refs/heads/${GITHUB_HEAD_REF}" - git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "refs/heads/${GITHUB_HEAD_REF}")" + echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" + git ls-remote --exit-code --heads https://github.com/infrawatch/sg-bridge.git "$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")" - name: Start sg-bridge from container image if: steps.bridge_branch.outcome != 'success' run: | diff --git a/ci/integration/logging/run_bridge.sh b/ci/integration/logging/run_bridge.sh index 30b94fc8..e66b7a0d 100644 --- a/ci/integration/logging/run_bridge.sh +++ b/ci/integration/logging/run_bridge.sh @@ -11,7 +11,7 @@ sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-OpsTools.repo dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config # install and start sg-bridge -BRANCH="$(echo "refs/heads/${GITHUB_HEAD_REF}")" +BRANCH="$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")" git clone https://github.com/infrawatch/sg-bridge.git pushd sg-bridge git checkout $BRANCH || true diff --git a/ci/integration/metrics/run_bridge.sh b/ci/integration/metrics/run_bridge.sh index f28c2dea..4cf1f0f1 100644 --- a/ci/integration/metrics/run_bridge.sh +++ b/ci/integration/metrics/run_bridge.sh @@ -13,7 +13,7 @@ sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-OpsTools.repo dnf install -y git gcc make qpid-proton-c-devel redhat-rpm-config # install and start sg-bridge -BRANCH="$(echo "refs/heads/${GITHUB_HEAD_REF}")" +BRANCH="$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}")" git clone https://github.com/infrawatch/sg-bridge.git pushd sg-bridge git checkout $BRANCH || true