From the documentation of github actions:
outputs:
random-number:
description: "Random number"
value: ${{ steps.random-number-generator.outputs.random-id }}
runs:
using: "composite"
steps:
- id: random-number-generator
run: echo "::set-output name=random-id::$(echo $RANDOM)"
shell: bash
In the run clause 2 echos exist, one for the whole line and one echo $RANDOM
Isn't the second echo unnessecary?
On my computer
echo "::set-output name=random-id::$(echo $RANDOM)"
outputs:
::set-output name=random-id::28124
while
echo "::set-output name=random-id::$RANDOM"
outputs
::set-output name=random-id::28123
so both works.
So why is $(echo $RANDOM) needed ?