0

I am trying to create a workflow that takes in some inputs, boolean, and uses them to deploy to specific sites using deploy tokens for that particular site.

Now, I have the following sample inputs and matrix defined:

Inputs

ABC:
    type: boolean
    description: ABC
XYZ:
    type: boolean
    description: XYZ

Matrix:

- project: ABC
     site_id: abc
     deploy_token_name: deploy_token_abc
     deploy_id: abc
- project: XYZ
     site_id: xyz
     deploy_token_name: deploy_token_xyz
     deploy_id: xyz

I want to add only those values into the matrix that are selected in the inputs in the workflow_dispatch.

Is there a way to do this?

av8304
  • 17
  • 1
  • 6
  • Please include in your question what you've tried so far. Thanks! – Azeem May 08 '23 at 11:16
  • I tried using direct reference: https://stackoverflow.com/questions/76170597/how-to-reference-matrix-info-with-github-action-inputs But I don't think this will work Also, I was going through this approach https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional, and got stuck with how to add multiple values in the matrix based on boolean inputs. – av8304 May 08 '23 at 11:21
  • Read deploy_id which is defined in another file in the same folder ``` matrix=$(jq 'map( . | select(${{github.events.inputs.${}}}) )') ``` – av8304 May 08 '23 at 11:38
  • Please add a complete workflow with inputs, jobs, and steps showing the point where you're stuck or facing issues. That'll help understand your use case more clearly. – Azeem May 08 '23 at 13:46

0 Answers0