Skip to content

Commit

Permalink
fix jq code (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu authored Feb 11, 2025
1 parent f22f1a6 commit 6833950
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/backups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ jobs:
- id: set-matrix
run: |
matrix=$(curl https://nf-co.re/pipeline_names.json)
# Extract the pipeline array from the JSON structure
matrix=$(echo $matrix | jq '.pipeline')
if [ -n "${{ inputs.pipeline }}" ] && [ "${{ inputs.pipeline }}" != "all" ]; then
matrix=$(echo $matrix | jq --arg pipeline "${{ inputs.pipeline }}" '[.[] | select(.name == $pipeline)]')
matrix=$(echo $matrix | jq --arg pipeline "${{ inputs.pipeline }}" '[.[] | select(. == $pipeline)]')
fi
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 6833950

Please sign in to comment.