Testing capturing step output #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
name: Capture Step Output | ||
on: | ||
- push | ||
env: | ||
FORCE_COLOR: 1 | ||
jobs: | ||
capture_output: | ||
runs-on: "ubuntu-24.04" | ||
steps: | ||
- name: Generate output | ||
id: generate_output | ||
run: | | ||
echo "Generating a random number" | ||
RANDOM_NUMBER=$RANDOM | ||
echo "random_number=$RANDOM_NUMBER" >> $GITHUB_OUTPUT | ||
- name: Use output from previous step | ||
run: echo "Random number is: ${{ steps.generate_output.outputs.random_number }}" | ||