-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.76 KB
/
environment-variables.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Environment Variables
env:
WORKSPACE_ENVIRONMENT_VARIABLE: 'custom workspace environment variable'
on: [push]
jobs:
ubuntu:
env:
JOB_ENVIRONMENT_VARIABLE: 'custom job environment variable for ubuntu'
runs-on: ubuntu-latest
steps:
- name: Print custom environment variables from ubuntu-latest
env:
STEP_ENVIRONMENT_VARIABLE: 'custom step environment variable for bash'
run: |
echo "Accessing environment variables in run command"
echo "$WORKSPACE_ENVIRONMENT_VARIABLE"
echo "$JOB_ENVIRONMENT_VARIABLE"
echo "$STEP_ENVIRONMENT_VARIABLE"
echo "------------------------------------------------------"
echo "Accessing environment variables using env context"
echo "${{ env.WORKSPACE_ENVIRONMENT_VARIABLE }}"
echo "${{ env.JOB_ENVIRONMENT_VARIABLE }}"
echo "${{ env.STEP_ENVIRONMENT_VARIABLE }} Not defined"
windows:
env:
JOB_ENVIRONMENT_VARIABLE: 'custom job environment variable for windows'
runs-on: windows-latest
steps:
- name: Print custom environment variables from windows-latest
env:
STEP_ENVIRONMENT_VARIABLE: 'custom step environment variable for powershell'
run: |
echo "Accessing environment variables in run command"
echo "$Env:WORKSPACE_ENVIRONMENT_VARIABLE"
echo "$Env:JOB_ENVIRONMENT_VARIABLE"
echo "$Env:STEP_ENVIRONMENT_VARIABLE"
echo "------------------------------------------------------"
echo "Accessing environment variables using env context"
echo "${{ env.WORKSPACE_ENVIRONMENT_VARIABLE }}"
echo "${{ env.JOB_ENVIRONMENT_VARIABLE }}"
echo "${{ env.STEP_ENVIRONMENT_VARIABLE }} Not defined"