Skip to content

Commit

Permalink
Testing capturing step output
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Jun 4, 2024
1 parent d30a7ac commit 5525cf0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/env_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
- run: |
echo "Environment: $ENVIRONMENT"
echo "Secret: ${{ secrets.MY_SECRET }}"
- run: env
- name: "Testing variables in ${{ env.ENVIRONMENT }}"
run: |
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

---
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 "${{ steps.generate_output.outputs.random_number }}"


0 comments on commit 5525cf0

Please sign in to comment.