-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.49 KB
/
contexts.yml
File metadata and controls
50 lines (46 loc) · 1.49 KB
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
name: Context
on: [push, pull_request]
jobs:
functions:
runs-on: ubuntu-16.04
steps:
- name: dump
run: |
echo ${{ contains('hello', 'll') }}
echo ${{ startsWith('hello', 'll') }}
echo ${{ endsWith('hello', 'll') }}
echo ${{ format('Hello {0} {1} {2}', 'World', '!', '!') }}
one:
runs-on: ubuntu-16.04
# You can use if statements (no need for curly brackets)
# This job only runs if it's a push event.
if: github.event_name == 'push'
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
# Intentional error to test if: failure() and if: always() below
run: eccho "$GITHUB_CONTEXT"
- name: Dump job context
if: failure() # Only echo the $JOB_CONTEXT if there's a failure
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
# No matter what happens, it will run
if: always()
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"