-
Notifications
You must be signed in to change notification settings - Fork 4
138 lines (123 loc) · 6.04 KB
/
assign-env-from-json.yml
File metadata and controls
138 lines (123 loc) · 6.04 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Set Environment Variables from JSON
on:
workflow_call: # Add additional dispatched output properties
outputs:
release_dir:
description: The release_dir property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.release_dir }}
name:
description: The release_dir property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.name }}
integration_type:
description: The release_dir property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.integration_type }}
update_catalog:
description: The release_dir property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.update_catalog }}
release_project:
description: The release_project property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.release_project }}
UOFramework:
description: The UOFramework property from integration-manifest.json
value: ${{ jobs.assign-from-json.outputs.UOFramework }}
jobs:
assign-from-json:
runs-on: ubuntu-latest
outputs: # Add properties to be sent to dispatched workflow(s)
release_dir: ${{ steps.read-release_dir.outputs.output-value }}
name: ${{ steps.read-name.outputs.output-value }}
integration_type: ${{ steps.read-type.outputs.output-value }}
update_catalog: ${{ steps.read-update_catalog.outputs.output-value }}
UOFramework: ${{ steps.read-UOFramework.outputs.output-value }}
description: ${{ steps.read-description.outputs.output-value }}
release_project: ${{ steps.read-release_project.outputs.output-value }}
name: Set workflow variables from integration-manifest.json
steps:
- name: checkout-json-file
uses: keyfactor/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: src
- name: checkout-action
uses: keyfactor/checkout@v4
with:
repository: fiddlermikey/assign-from-json
path: tools
- name: Adding initial markdown for Summary
id: adding-initial-markdown
run: echo '### Reading integration-manifest.json' > $GITHUB_STEP_SUMMARY
- name: Read name property
uses: ./tools
id: read-name
with:
input-file: 'src/integration-manifest.json'
input-property: 'name'
- name: Read integration_type property
uses: ./tools
id: read-type
with:
input-file: 'src/integration-manifest.json'
input-property: 'integration_type'
- name: Read release_project property
uses: ./tools
id: read-release_project
with:
input-file: 'src/integration-manifest.json'
input-property: 'release_project'
required-value: 'false'
- name: Read update_catalog property
uses: ./tools
id: read-update_catalog
with:
input-file: 'src/integration-manifest.json'
input-property: 'update_catalog'
- name: Read pam_support property
if: steps.read-type.outputs.output-value == 'orchestrator'
uses: ./tools
id: read-pam_support
with:
input-file: 'src/integration-manifest.json'
input-property: 'about.orchestrator.pam_support'
required-value: 'false'
- name: Read UOFramework property
if: steps.read-type.outputs.output-value == 'orchestrator'
uses: ./tools
id: read-UOFramework
with:
input-file: 'src/integration-manifest.json'
input-property: 'about.orchestrator.UOFramework'
- name: Read keyfactor_platform_version property
if: steps.read-type.outputs.output-value == 'orchestrator' && steps.read-pam_support.outputs.output-value == 'true'
uses: ./tools
id: read-keyfactor_platform_version
with:
input-file: 'src/integration-manifest.json'
input-property: 'about.orchestrator.keyfactor_platform_version'
- name: Read release_dir property
uses: ./tools
id: read-release_dir
with:
input-file: 'src/integration-manifest.json'
input-property: 'release_dir'
- name: Read description property
uses: ./tools
id: read-description
with:
input-file: 'src/integration-manifest.json'
input-property: 'description'
- name: Write variables to Summary
id: adding-final-markdown
run: |
echo "### Integration Manifest Properties:" >> $GITHUB_STEP_SUMMARY
echo "* ${{ steps.read-name.outputs.output-property }} : ${{ steps.read-name.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
echo "* ${{ steps.read-type.outputs.output-property }} : ${{ steps.read-type.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
echo "* ${{ steps.read-update_catalog.outputs.output-property }} : ${{ steps.read-update_catalog.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.read-type.outputs.output-value }}" == 'orchestrator' ]]; then
echo "* ${{ steps.read-UOFramework.outputs.output-property }} : ${{ steps.read-UOFramework.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
echo "* ${{ steps.read-pam_support.outputs.output-property }} : ${{ steps.read-pam_support.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.read-pam_support.outputs.output-value }}" == 'true' ]]; then
echo "* ${{ steps.read-keyfactor_platform_version.outputs.output-property }} : ${{ steps.read-keyfactor_platform_version.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
fi
fi
echo "* ${{ steps.read-release_dir.outputs.output-property }} : ${{ steps.read-release_dir.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY
echo "* ${{ steps.read-release_project.outputs.output-property }} : ${{ steps.read-release_project.outputs.output-value }}" >> $GITHUB_STEP_SUMMARY