Skip to content

Commit

Permalink
fix(ci): correct network matrix generation for workflow dispatch
Browse files Browse the repository at this point in the history
- Fix JSON array generation for manually triggered deployments
- Ensure a valid JSON array is created when a single network is selected
- Improve matrix configuration for workflow dispatch events
  • Loading branch information
gustavovalverde committed Feb 3, 2025
1 parent 0c8393a commit 34e7f0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ jobs:
- id: set-networks
run: |

Check warning on line 241 in .github/workflows/cd-deploy-nodes-gcp.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/cd-deploy-nodes-gcp.yml#L241

shellcheck reported issue in this script: SC2086:info:3:48: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/cd-deploy-nodes-gcp.yml:241:9: shellcheck reported issue in this script: SC2086:info:3:48: Double quote to prevent globbing and word splitting [shellcheck]

Check warning on line 241 in .github/workflows/cd-deploy-nodes-gcp.yml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] .github/workflows/cd-deploy-nodes-gcp.yml#L241

shellcheck reported issue in this script: SC2086:info:5:42: Double quote to prevent globbing and word splitting [shellcheck]
Raw output
.github/workflows/cd-deploy-nodes-gcp.yml:241:9: shellcheck reported issue in this script: SC2086:info:5:42: Double quote to prevent globbing and word splitting [shellcheck]
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "matrix=[${{ toJSON(inputs.network) }}]" >> $GITHUB_OUTPUT
# Manually triggered deployment: output a valid JSON array with the single chosen network.
echo "matrix=[\"${{ inputs.network }}\"]" >> $GITHUB_OUTPUT
else
echo 'matrix=["Mainnet","Testnet"]' >> $GITHUB_OUTPUT
fi
Expand Down

0 comments on commit 34e7f0d

Please sign in to comment.