kubewarden / helm-charts

Helm charts for the Kubewarden project
Apache License 2.0
25 stars 16 forks source link

ci: Add UI inputs for `Update helm charts` job #399

Closed viccuad closed 5 months ago

viccuad commented 5 months ago

Description

Fix https://github.com/kubewarden/helm-charts/issues/307.

Add UI inputs when workflow triggered as workflow_dispatch.

Given that the values can come from repository_dispatch (other repos) or workflow_dispatch (UI button), add a new setvariables job, that sets its job outputs to the corresponding values obtained from the payload of the repository_dispatch or from the inputs of the workflow_dispatch. It is needed to use job outputs as is the only way to pass values between jobs, as jobs are run in their own VM instances and don't share the env.

Make the following jobs depend on it with needs: setvariables.

The javascript script from actions/github-script cannot read job outputs. Hence, add a step that reads the needs.setvariables.outputs and creates env vars. Consume those env vars in js as process.env.foo.

image

Test

Tested manually from my fork, to the point that the job tries to download the crds asset, where it fails. See: https://github.com/viccuad/helm-charts/actions/runs/8252069909

Additional Information

Tradeoff

Potential improvement

I don't like the amount of complexity this adds to this workflow.

viccuad commented 5 months ago

Converting to draft in favour of https://github.com/kubewarden/helm-charts/pull/400.

viccuad commented 5 months ago

Closing in favour of https://github.com/kubewarden/helm-charts/pull/400.