test vars in push / pr #5
Workflow file for this run
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: test_env_set | |
# only run this job when this job itself is modified | |
on: | |
push: | |
paths: | |
- ".github/workflows/test_env_set.yaml" | |
branches: | |
- "**" | |
pull_request: | |
paths: | |
- ".github/workflows/test_env_set.yaml" | |
env: | |
EXAMPLESUFFIX: _initialvalue | |
jobs: | |
test_env_set: | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: get env var | |
run: echo "$EXAMPLESUFFIX" | |
- name: set env var | |
if: github.event_name != 'pull_request' | |
run: echo "EXAMPLESUFFIX=_pushvalue" >> "$GITHUB_ENV" | |
- name: set env var | |
if: github.event_name == 'pull_request' | |
run: echo "EXAMPLESUFFIX=_pullrequestvalue" >> "$GITHUB_ENV" | |
- name: get env var | |
run: echo "$EXAMPLESUFFIX" | |
- name: get env var | |
run: echo "${{ env.EXAMPLESUFFIX }}" |