Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A0-2998: Put 'true' in double quote in one the conditions to check if that helps #1346

Merged
11 commits merged into from
Aug 11, 2023
35 changes: 31 additions & 4 deletions .github/workflows/_check-vars-and-secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ name: Check vars and secrets
on:
workflow_call:
inputs:
check-dev-vars:
description: Should dev vars be checked
required: false
type: boolean
default: true
check-vars:
description: Should vars be checked
required: false
Expand All @@ -21,24 +26,46 @@ jobs:
name: Check available vars and secrets
runs-on: ubuntu-20.04
steps:
- name: Check dev vars
run: |
if [[ "${{ inputs.check-dev-vars }}" != "true" ]]; then
echo "Skipping dev vars check"
exit 0
fi

if [[ \
-z "${{ vars.RUST_TOOLCHAIN_NIGHTLY }}" \
]]; then
echo "!!! Some repository variables are either missing or empty."
echo "!!! Please check either repository or organization settings."
exit 1
fi

- name: Check vars
if: inputs.check-vars == true
run: |
if [[ "${{ inputs.check-vars }}" != "true" ]]; then
echo "Skipping vars check"
exit 0
fi

if [[ \
-z "${{ vars.ECR_PUBLIC_HOST }}" || \
-z "${{ vars.ECR_PUBLIC_REGISTRY }}" || \
ggawryal marked this conversation as resolved.
Show resolved Hide resolved
-z "${{ vars.DOCKERHUB_ALEPH_NODE_REPO }}" || \
-z "${{ vars.ECR_ALEPH_NODE_REPO }}" || \
-z "${{ vars.RUST_TOOLCHAIN_NIGHTLY }}" \
-z "${{ vars.ECR_ALEPH_NODE_REPO }}" \
]]; then
echo "!!! Some repository variables are either missing or empty."
echo "!!! Please check either repository or organization settings."
exit 1
fi

- name: Check secrets
if: inputs.check-secrets == true
run: |
if [[ "${{ inputs.check-secrets }}" != "true" ]]; then
echo "Skipping secrets check"
exit 0
fi

if [[ \
-z "${{ secrets.ARGOCD_DEVNET_HOST }}" || \
-z "${{ secrets.ARGO_SYNC_USER_TOKEN }}" || \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/on-pull-request-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
check-vars:
name: Check vars
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit
with:
check-secrets: false
check-vars: false

check-excluded-packages:
name: Check excluded packages
Expand Down
Loading