-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnested-alias.yml
More file actions
71 lines (66 loc) · 1.61 KB
/
nested-alias.yml
File metadata and controls
71 lines (66 loc) · 1.61 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Nested YAML Alias
vars:
test_value: "{{ TEST_VALUE ?? 'test' }}"
aliases:
base_value: &base_value "{{ vars.test_value }}"
default_config: &default_config
content-type: application/json
accept: application/json
auth_config: &a_config
authorization: Bearer xxxxxxxxxxxxx
custom_config: &x_config
x-foo: foo
bundle_config: &b_config
<<: [*a_config, *x_config]
x-bar: bar
x-baz: baz
double_mergekey_config: &d_config
<<: *a_config
<<: *x_config
x-bar: bar
x-baz: baz
jobs:
- name: Test Job
steps:
- name: Test basic alias
uses: shell
with:
cmd: echo "hello"
vars:
base: *base_value
config: *default_config
test: |
res.code == 0 &&
replace(res.stdout, '\n', '') == "hello"
echo: |
Base value: {{vars.base}}
outputs:
result: replace(res.stdout, '\n', '')
- name: Verify mergekey list
uses: shell
with:
cmd: echo "testing mergekey"
vars:
config: *b_config
test: |
res.code == 0 &&
vars.config.authorization == "Bearer xxxxxxxxxxxxx" &&
vars.config["x-bar"] == "bar" &&
vars.config["x-baz"] == "baz" &&
vars.config["x-foo"] == "foo"
echo: |
Config: {{vars.config}}
- name: Verify double mergekey
uses: shell
with:
cmd: echo "testing double mergekey"
vars:
config: *d_config
test: |
res.code == 0 &&
vars.config.authorization == "Bearer xxxxxxxxxxxxx" &&
vars.config["x-bar"] == "bar" &&
vars.config["x-baz"] == "baz" &&
vars.config["x-foo"] == "foo"
echo: |
Config: {{vars.config}}