forked from ExamProCo/Github-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.88 KB
/
contexts.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Visualising Contexts Workflow
on:
workflow_dispatch:
env:
TEST_ENV_W: "just a test in workflow"
jobs:
show-contexts:
runs-on: ubuntu-latest
env:
TEST_ENV_J: "just a test in job"
steps:
- id: showing-workflow-context
name: Showing Workflow Context
env:
GITHUB_CONTEXT_JSON: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT_JSON"
echo "Run Attempts via context: ${{ github.run_attempt }}"
echo "Run Attempts via env: $RUN_ATTEMPT"
- id: showing-job-context
name: Showing Job Context
env:
JOB_CONTEXT_JSON: ${{ toJson(job) }}
run: |
echo "$JOB_CONTEXT_JSON"
echo "Run Services via context: ${{ job.services }}"
- id: showing-steps-context
name: Showing Steps Context
env:
STEPS_CONTEXT_JSON: ${{ toJson(steps) }}
run: |
echo "$STEPS_CONTEXT_JSON"
- id: showing-runner-context
name: Showing Runner Context
env:
RUNNER_CONTEXT_JSON: ${{ toJson(runner) }}
run: |
echo "$RUNNER_CONTEXT_JSON"
- id: showing-env-context
name: Showing Env Context
env:
ENV_XXX: "xxx"
ENV_CONTEXT_JSON: ${{ toJson(env) }}
run: |
echo "$ENV_CONTEXT_JSON"
echo "TEST_ENV_W: $TEST_ENV_W"
echo "ENV_XXX: $ENV_XXX"
echo "RUNNER_CONTEXT_JSON: $RUNNER_CONTEXT_JSON"
- id: showing-vars-context
name: Showing Vars Context
env:
VARS_CONTEXT_JSON: ${{ toJson(vars) }}
run: |
echo "$VARS_CONTEXT_JSON"
- id: showing-secrets-context
name: Showing Secrets Context
env:
SECRETS_CONTEXT_JSON: ${{ toJson(secrets) }}
run: |
echo "$SECRETS_CONTEXT_JSON"