Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglonghong committed Aug 4, 2024
1 parent 7a8c27d commit 14d2721
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ jobs:
- uses: actions/checkout@v3

- name: Set Environment Variable
id: set-env
run: |
echo "MY_ENV_VAR=HelloWorld" >> $GITHUB_ENV
outputs:
my_env_var: ${{ steps.set-env.outputs.MY_ENV_VAR }}

example_job:
runs-on: ubuntu-latest
Expand All @@ -25,11 +28,11 @@ jobs:
uses: actions/checkout@v3

- name: Get Environment Variable
run: echo "The value of MY_ENV_VAR is ${{ env.MY_ENV_VAR }}"
run: echo "The value of MY_ENV_VAR is ${{ needs.set_env_var.output.my_env_var }}"

- name: Use Environment Variable in Another Step
run: |
if [[ "${{ env.MY_ENV_VAR }}" == "HelloWorld" ]]; then
if [[ "${{ needs.set_env_var.output.my_env_var }}" == "HelloWorld" ]]; then
echo "The environment variable is correctly set!"
else
echo "The environment variable is not set correctly."
Expand Down

0 comments on commit 14d2721

Please sign in to comment.