-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathaction.yml
More file actions
69 lines (59 loc) · 1.95 KB
/
action.yml
File metadata and controls
69 lines (59 loc) · 1.95 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: 'Validate Required Variables'
description: 'Validates that all required secrets and variables for Control Plane operations'
inputs:
CPLN_TOKEN_STAGING:
required: true
description: 'Control Plane Staging Token'
CPLN_TOKEN_PRODUCTION:
required: true
description: 'Control Plane Production Token'
CPLN_ORG_STAGING:
required: true
description: 'Control Plane Staging Organization'
CPLN_ORG_PRODUCTION:
required: true
description: 'Control Plane Production Organization'
REVIEW_APP_PREFIX:
required: true
description: 'Review App Prefix'
PRODUCTION_APP_NAME:
required: true
description: 'Production App Name'
STAGING_APP_NAME:
required: true
description: 'Staging App Name'
runs:
using: 'composite'
steps:
- name: Validate Required Secrets and Variables
shell: bash
run: |
missing=()
# Check required secrets
if [ -z "${{ inputs.CPLN_TOKEN_STAGING }}" ]; then
missing+=("Secret: CPLN_TOKEN_STAGING")
fi
if [ -z "${{ inputs.CPLN_TOKEN_PRODUCTION }}" ]; then
missing+=("Secret: CPLN_TOKEN_PRODUCTION")
fi
# Check required variables
if [ -z "${{ inputs.CPLN_ORG_STAGING }}" ]; then
missing+=("Variable: CPLN_ORG_STAGING")
fi
if [ -z "${{ inputs.CPLN_ORG_PRODUCTION }}" ]; then
missing+=("Variable: CPLN_ORG_PRODUCTION")
fi
if [ -z "${{ inputs.REVIEW_APP_PREFIX }}" ]; then
missing+=("Variable: REVIEW_APP_PREFIX")
fi
if [ -z "${{ inputs.PRODUCTION_APP_NAME }}" ]; then
missing+=("Variable: PRODUCTION_APP_NAME")
fi
if [ -z "${{ inputs.STAGING_APP_NAME }}" ]; then
missing+=("Variable: STAGING_APP_NAME")
fi
if [ ${#missing[@]} -ne 0 ]; then
echo "Missing required secrets/variables:"
printf '%s\n' "${missing[@]}"
exit 1
fi