Skip to content

Commit 7287181

Browse files
authored
🐛 🧙 Cast workflow inputs to booleans (#1564)
* 🐛 🧙 Cast workflow inputs to booleans Transform `workflow_dispatch` inputs to correct boolean types for workflow calls. GitHub `workflow_dispatch` always provides inputs as strings, causing failures when passed to `workflow_call` parameters expecting boolean values. Added a dedicated step that converts string values to booleans by using explicit string comparison with the pattern (`value == 'true'`). * Renamed job from `export-versions` to `prep` for clarity * Added boolean casting step with explicit string comparison * Updated all references to use the new job name * Fixed parameter passing in `deploy-test-eks` workflow call
1 parent fc49b34 commit 7287181

File tree

2 files changed

+53
-31
lines changed

2 files changed

+53
-31
lines changed

.github/workflows/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ The CI/CD pipeline is defined in the [cicd.yml](cicd.yml) file.
77
title: CI/CD Pipeline
88
---
99
flowchart LR
10-
ExportVersions(Export tool versions)
10+
PrepWorkflow(Prep Workflow)
1111
Lint(Lint / Format)
1212
TestsUnit(Tests / Unit)
1313
DockerBuild(Docker / Build)
1414
DockerPush(Docker / Push)
1515
TestsLocal(Tests / Local)
1616
EKSDeploy(EKS / Deploy)
1717
EKSTestE2E(EKS / Tests / End-to-End)
18+
EKSTestRegression(EKS / Tests / Regression)
1819
EKSTestK6(EKS / Tests / K6)
1920
Notify(Notify / didx-cloud)
2021
OpenAPI(OpenAPI / Diff)
2122
22-
ExportVersions --> Lint
23-
ExportVersions --> TestsUnit
23+
PrepWorkflow --> Lint
24+
PrepWorkflow --> TestsUnit
2425
Lint --> DockerBuild
2526
TestsUnit --> DockerBuild
2627
DockerBuild --> DockerPush
@@ -29,8 +30,10 @@ flowchart LR
2930
DockerPush --> OpenAPI
3031
EKSDeploy --> EKSTestE2E
3132
EKSDeploy --> EKSTestK6
33+
EKSDeploy --> EKSTestRegression
3234
EKSTestE2E --> Notify
3335
EKSTestK6 --> Notify
36+
EKSTestRegression --> Notify
3437
TestsLocal --> Notify
3538
```
3639

.github/workflows/cicd.yml

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -55,44 +55,63 @@ env:
5555
HELMFILE_VERSION: v1.0.0
5656
MISE_VERSION: 2025.5.0
5757

58+
RESET_DEPLOYMENTS: ${{ github.event.inputs.reset-deployments || 'false' }}
59+
RUN_E2E_TESTS: ${{ github.event.inputs.run-e2e-tests || 'true' }}
60+
RUN_K6_TESTS: ${{ github.event.inputs.run-k6-tests || 'true' }}
61+
RUN_REGRESSION_TESTS: ${{ github.event.inputs.run-regression-tests || 'true' }}
62+
5863
jobs:
59-
export-versions:
60-
name: Export tool versions
64+
prep:
65+
name: Prep workflow
6166
runs-on: ubuntu-latest
62-
63-
###
64-
# Needed because we can't pass env vars (`${{ env.HELM_VERSION }}`) to `workflow_call`
65-
###
66-
6767
outputs:
68-
HELM_VERSION: ${{ steps.export.outputs.HELM_VERSION }}
69-
HELMFILE_VERSION: ${{ steps.export.outputs.HELMFILE_VERSION }}
70-
MISE_VERSION: ${{ steps.export.outputs.MISE_VERSION }}
68+
###
69+
# Because we can't pass env vars (`${{ env.HELM_VERSION }}`) to `workflow_call`
70+
###
71+
helm-version: ${{ steps.export-versions.outputs.helm-version }}
72+
helmfile-version: ${{ steps.export-versions.outputs.helmfile-version }}
73+
mise-version: ${{ steps.export-versions.outputs.mise-version }}
74+
75+
###
76+
# Because https://github.com/actions/runner/issues/1483
77+
###
78+
reset-deployments: ${{ steps.export-bools.outputs.reset-deployments }}
79+
run-e2e-tests: ${{ steps.export-bools.outputs.run-e2e-tests }}
80+
run-k6-tests: ${{ steps.export-bools.outputs.run-k6-tests }}
81+
run-regression-tests: ${{ steps.export-bools.outputs.run-regression-tests }}
7182

7283
steps:
7384
- name: Export tool versions
74-
id: export
85+
id: export-versions
86+
run: |
87+
echo "helm-version=${HELM_VERSION}" >> $GITHUB_OUTPUT
88+
echo "helmfile-version=${HELMFILE_VERSION}" >> $GITHUB_OUTPUT
89+
echo "mise-version=${MISE_VERSION}" >> $GITHUB_OUTPUT
90+
91+
- name: Export boolean env vars
92+
id: export-bools
7593
run: |
76-
echo "HELM_VERSION=${HELM_VERSION}" >> $GITHUB_OUTPUT
77-
echo "HELMFILE_VERSION=${HELMFILE_VERSION}" >> $GITHUB_OUTPUT
78-
echo "MISE_VERSION=${MISE_VERSION}" >> $GITHUB_OUTPUT
94+
echo "reset-deployments=${RESET_DEPLOYMENTS}" >> $GITHUB_OUTPUT
95+
echo "run-e2e-tests=${RUN_E2E_TESTS}" >> $GITHUB_OUTPUT
96+
echo "run-k6-tests=${RUN_K6_TESTS}" >> $GITHUB_OUTPUT
97+
echo "run-regression-tests=${RUN_REGRESSION_TESTS}" >> $GITHUB_OUTPUT
7998
8099
lint:
81100
name: Lint
82-
needs: export-versions
101+
needs: prep
83102
uses: ./.github/workflows/format.yml
84103
with:
85-
mise-version: ${{ needs.export-versions.outputs.MISE_VERSION }}
104+
mise-version: ${{ needs.prep.outputs.mise-version }}
86105
concurrency:
87106
group: format-check-${{ github.ref_name }}
88107
cancel-in-progress: true
89108

90109
unit-test:
91110
name: Tests
92-
needs: export-versions
111+
needs: prep
93112
uses: ./.github/workflows/unit.yml
94113
with:
95-
mise-version: ${{ needs.export-versions.outputs.MISE_VERSION }}
114+
mise-version: ${{ needs.prep.outputs.mise-version }}
96115
concurrency:
97116
group: unit-test-${{ github.ref_name }}
98117
cancel-in-progress: true
@@ -130,11 +149,11 @@ jobs:
130149
name: Tests
131150
needs:
132151
- docker
133-
- export-versions
152+
- prep
134153
uses: ./.github/workflows/local-tests.yml
135154
with:
136155
image-version: ${{ needs.docker.outputs.image_version }}
137-
mise-version: ${{ needs.export-versions.outputs.MISE_VERSION }}
156+
mise-version: ${{ needs.prep.outputs.mise-version }}
138157
secrets:
139158
codacy-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
140159
concurrency:
@@ -147,20 +166,20 @@ jobs:
147166
uses: ./.github/workflows/deploy-test-eks.yml
148167
needs:
149168
- docker
150-
- export-versions
169+
- prep
151170
with:
152171
acapy-helmfile-path: ./helm/acapy-cloud.yaml.gotmpl
153172
acapy-test-helmfile-path: ./helm/acapy-test.yaml.gotmpl
154173
connect-configs-dir: ./resources/connect-processors/cloud
155174
helm-plugins: https://github.com/databus23/helm-diff
156-
helm-version: ${{ needs.export-versions.outputs.HELM_VERSION }}
157-
helmfile-version: ${{ needs.export-versions.outputs.HELMFILE_VERSION }}
175+
helm-version: ${{ needs.prep.outputs.helm-version }}
176+
helmfile-version: ${{ needs.prep.outputs.helmfile-version }}
158177
image-version: ${{ needs.docker.outputs.image_version }}
159178
namespace: acapy-cloud-dev
160-
reset-deployments: ${{ github.event.inputs.reset-deployments || false }}
161-
run-e2e-tests: ${{ github.event.inputs.run-e2e-tests || true }}
162-
run-k6-tests: ${{ github.event.inputs.run-k6-tests || true }}
163-
run-regression-tests: ${{ github.event.inputs.run-regression-tests || true }}
179+
reset-deployments: ${{ needs.prep.outputs.reset-deployments == 'true' }}
180+
run-e2e-tests: ${{ needs.prep.outputs.run-e2e-tests == 'true' }}
181+
run-k6-tests: ${{ needs.prep.outputs.run-k6-tests == 'true' }}
182+
run-regression-tests: ${{ needs.prep.outputs.run-regression-tests == 'true' }}
164183
tailscale-tags: ${{ vars.TAILSCALE_TAGS }}
165184
secrets:
166185
tailscale-oauth-client-id: ${{ secrets.TAILSCALE_OAUTH_CLIENT_ID }}
@@ -179,8 +198,8 @@ jobs:
179198
needs:
180199
- docker
181200
- eks
182-
- export-versions
183201
- local-test
202+
- prep
184203

185204
uses: ./.github/workflows/notify.yml
186205
with:

0 commit comments

Comments
 (0)