Is it possible to get outputs from a bash script? #1336
-
I'm trying to run a .sh script from a composite action, and get some output back using something like So my question is twofold:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can set output from within a shell script, the bash script must be able to print to the stdout so the runner sees the command
Yes script.sh
.github/workflows/test.yml on: push
jobs:
_:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
bash ./script.sh
id: myscript
shell: bash
- run: |
echo "$SCRIPTOUTPUT"
shell: bash
env:
SCRIPTOUTPUT: "${{ tojson(steps.myscript.outputs) }}" Sample log:
|
Beta Was this translation helpful? Give feedback.
You can set output from within a shell script, the bash script must be able to print to the stdout so the runner sees the command
Yes
script.sh
.github/workflows/test.yml
Sample log: