-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68878a3
commit 3ed00b7
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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" |