From e5079067a392819d05024d39bf78570821aca1b0 Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Tue, 4 Jun 2024 11:57:36 -0700 Subject: [PATCH] Testing capturing step output --- .github/workflows/env_vars.yml | 3 --- .github/workflows/steps.yml | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/steps.yml diff --git a/.github/workflows/env_vars.yml b/.github/workflows/env_vars.yml index 4971763..614c885 100644 --- a/.github/workflows/env_vars.yml +++ b/.github/workflows/env_vars.yml @@ -19,9 +19,6 @@ jobs: - run: | echo "Environment: $ENVIRONMENT" - echo "Secret: ${{ secrets.MY_SECRET }}" - - - run: env - name: "Testing variables in ${{ env.ENVIRONMENT }}" run: | diff --git a/.github/workflows/steps.yml b/.github/workflows/steps.yml new file mode 100644 index 0000000..7f60f9b --- /dev/null +++ b/.github/workflows/steps.yml @@ -0,0 +1,20 @@ + +--- +name: Capture Step Output +on: + - push + +jobs: + capture_output: + runs-on: "ubuntu-24.04" + + steps: + - name: Generate random number + id: random + run: | + echo "Generating a random number" + echo "random_number=$RANDOM" >> $GITHUB_OUTPUT + + - name: Use output from previous step + run: echo "Random number ${{ steps.random.outputs.random_number }}" +