-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathaction.yml
More file actions
41 lines (35 loc) · 1.1 KB
/
action.yml
File metadata and controls
41 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: 'Validate Required Variables'
description: 'Validates that all required secrets and variables for Control Plane operations'
inputs:
org:
description: 'Organization name'
required: true
prefix:
description: 'Review App Prefix'
required: true
runs:
using: 'composite'
steps:
- name: Validate Required Secrets and Variables
shell: bash
env:
REVIEW_APP_PREFIX: ${{ inputs.prefix }}
CPLN_ORG_STAGING: ${{ inputs.org }}
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
run: |
missing=()
# Check required secrets
if [ -z "$CPLN_TOKEN_STAGING" ]; then
missing+=("Secret: CPLN_TOKEN_STAGING")
fi
# Check required variables
if [ -z "$CPLN_ORG_STAGING" ]; then
missing+=("Variable: CPLN_ORG_STAGING")
fi
if [ -z "$REVIEW_APP_PREFIX" ]; then
missing+=("Variable: REVIEW_APP_PREFIX")
fi
if [ ${#missing[@]} -ne 0 ]; then
echo "Required secrets/variables are not set: ${missing[*]}"
exit 1
fi