-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 2.17 KB
/
job-00-cookiecutter-read_configuration.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
---
name: job-00-cookiecutter-read_configuration
on:
workflow_call:
inputs:
CONFIGURATION_PATH:
default: "cookiecutter.json"
description: "Optional, allows you to specify the path to the 'cookiecutter.json' file."
required: false
type: string
REMOTE_SCRIPT_SET_VALUE:
default: "ci/github/scripts/step-set-value.sh"
description: "Optional, allows you to specify a workflow set value script."
required: false
type: string
SCENARIOS_PATH:
default: ".github/scenarios"
description: "Optional, allows you to specify the path to the 'cookiecutter.json' scenario variants."
required: false
type: string
outputs:
COOKIECUTTER_CONFIGURATION:
description: "The 'cookiecutter.json' file as a JSON encoded string."
value: ${{ jobs.configuration.outputs.CONFIGURATION }}
COOKIECUTTER_ALL_SCENARIOS:
description: "A string encoded JSON array of 'cookiecutter.json' variants for testing scenarios."
value: ${{ jobs.configuration.outputs.SCENARIOS }}
jobs:
configuration:
runs-on: ubuntu-latest
outputs:
CONFIGURATION: ${{ steps.cookiecutter_configuration.outputs.value }}
SCENARIOS: ${{ steps.cookiecutter_scenarios.outputs.value }}
steps:
- name: Create Configuration -- Checkout Repository
uses: actions/checkout@v4
- name: Create Configuration -- Install Toolbox
uses: ./.github/actions/action-00-toolbox
- name: Create Configuration -- Set Cookiecutter Configuration as Output
id: cookiecutter_configuration
run: |
bash "./.cicd-tools/boxes/active/${{ inputs.REMOTE_SCRIPT_SET_VALUE }}" \
cat "${{ inputs.CONFIGURATION_PATH }}"
shell: bash
- name: Create Configuration -- Set Scenarios as Output
id: cookiecutter_scenarios
run: |
mkdir -p ${{ inputs.SCENARIOS_PATH }}
bash "./.cicd-tools/boxes/active/${{ inputs.REMOTE_SCRIPT_SET_VALUE }}" \
python -c 'import os, json, pathlib; print(json.dumps([pathlib.Path(x).stem for x in os.listdir("${{ inputs.SCENARIOS_PATH }}")]))'
shell: bash