diff --git a/.github/workflows/pull-request-actions.yaml b/.github/workflows/pull-request-actions.yaml index d542bb0..e70cc64 100644 --- a/.github/workflows/pull-request-actions.yaml +++ b/.github/workflows/pull-request-actions.yaml @@ -7,6 +7,7 @@ on: pull_request: branches: - master + - staging jobs: shellcheck: diff --git a/bootstrap.sh b/bootstrap.sh index 3a21690..e303f86 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -37,12 +37,15 @@ if [ "$(yq -r '.clouds.openstack.auth.application_credential_id' clouds.yaml)" = exit 1 fi -if [ "$(yq -r '.clouds.openstack.auth.project_id' clouds.yaml)" == "null" ]; then +if [ "$(yq '.clouds.openstack.auth.project_id' clouds.yaml)" == "null" ]; then echo "Looking up project_id for clouds.yaml..." - APP_CRED_ID=$(yq -r '.clouds.openstack.auth.application_credential_id' clouds.yaml) - PROJECT_ID="$(openstack --os-cloud openstack application credential show "${APP_CRED_ID}" -c project_id -f value)" + APP_CRED_ID=$(yq '.clouds.openstack.auth.application_credential_id' clouds.yaml | tr -d '"') + PROJECT_ID=$(openstack --os-cloud openstack application credential show "${APP_CRED_ID}" -c project_id -f value) echo "Injecting project ID: '${PROJECT_ID}' into clouds.yaml..." - injected_id=$PROJECT_ID yq e '.clouds.openstack.auth.project_id = env(injected_id)' -i clouds.yaml + + # shellcheck disable=SC2016 + # needs to be single quotes for yq to work + yq -yi --arg injected_id "$PROJECT_ID" '.clouds.openstack.auth.project_id = $injected_id' clouds.yaml fi echo "Installing and starting microk8s..."