Skip to content

Commit e6b532b

Browse files
committed
Helm Chart CI/CD workflow: refine environment handling logic
1 parent eae1289 commit e6b532b

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/infrastructure-ci-cd.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Helm Chart CI/CD
2-
2+
permissions: read-all
3+
# [Deploying/Linting for] [<chart>/all charts] in [dev/test/prod/all environments]
4+
run-name: ${{ inputs.run_cd && 'Deploying ' || 'Linting for' }} ${{ github.event.action =='workflow_dispatch' && (inputs.chart == 'all' && 'all charts' || inputs.chart) || 'changed files'}} in ${{ inputs.environment == 'all' && 'all environments' || inputs.environment }}
35
on:
46
push:
57
branches: [main]
@@ -71,16 +73,11 @@ jobs:
7173
id: set-env-matrix
7274
run: |
7375
# Default environments
74-
environments=("dev" "test" "prod")
76+
environments=("${{ inputs.environment }}")
7577
76-
# Handle workflow_dispatch event
77-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
78-
if [[ "${{ inputs.environment }}" != "all" ]]; then
79-
environments=("${{ inputs.environment }}")
80-
fi
81-
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
82-
# For PRs, only test against dev environment
83-
environments=("dev")
78+
# Handle "all" case
79+
if [[ "${{ inputs.environment }}" == "all" ]]; then
80+
environments=("dev" "test" "prod")
8481
fi
8582
8683
# Convert to compact JSON array

0 commit comments

Comments
 (0)