Skip to content

Commit

Permalink
pathogen-repo-build: use eval to run input command
Browse files Browse the repository at this point in the history
Using `eval` to run the command to avoid potential errors
as we don't want limit the block scalars for the run input.

If run input includes a newline at the end, the direct interpolation of
`${{ inputs.run }}` results in a syntax error¹:
```
line 11: syntax error near unexpected token `|&'
```

¹ https://github.com/nextstrain/seasonal-flu/actions/runs/5604334827/jobs/10252159727#step:7:327
  • Loading branch information
joverlee521 committed Jul 20, 2023
1 parent 82191a6 commit 6aed9e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/pathogen-repo-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,13 @@ jobs:
| tee -a "$GITHUB_ENV"
- name: Run build via ${{ inputs.runtime }}
env:
NEXTSTRAIN_BUILD_COMMAND: ${{ inputs.run }}
run: |
# shellcheck disable=SC2154
set -x
${{ inputs.run }} |& tee build.log
eval "$NEXTSTRAIN_BUILD_COMMAND" |& tee build.log
- if: ${{ inputs.runtime == 'aws-batch' }}
name: Get AWS Batch job id
Expand Down

0 comments on commit 6aed9e2

Please sign in to comment.