I am trying to write a Github Action that outputs the result of a curl HTTP call to a JSON endpoint processed with jq to the output of that step, like so:
- name: Get existing Neon branch for this PR
id: get-existing-branch
run: |
echo "branch_id=$(
jq --raw-output '.branches[] | select(.name | startswith("PR #${{ inputs.pr-number }} ")).id' list-neon-branches-response.json
)" >> "$GITHUB_OUTPUT"
But I keep getting this error:
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'br-shrill-unit-918412'
I see a number of issues that generally tell people that they're doing it wrong for multiline strings, but that's where I'm stumped - this isn't multiline. Any ideas? Some source code:
Thanks all!
I changed it to this:
- name: Get existing Neon branch for this PR
id: get-existing-branch
run: |
branch_id="$(jq --raw-output '.branches[] | select(.name | startswith("PR #${{ inputs.pr-number }} ")).id' list-neon-branches-response.json)"
echo "Branch ID: $branch_id"
echo "branch_id=$branch_id" >> "$GITHUB_OUTPUT"
And now it’s happy. Welp.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With