-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
93 lines (83 loc) · 3.51 KB
/
action.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
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
name: 'Living Documentation Generator'
description: 'Generates living documentation from current state of user defined GitHub repositories.'
inputs:
# Base action inputs
GITHUB-TOKEN:
description: 'GitHub token for authentication.'
required: true
liv-doc-regime:
description: 'Enable or disable the LivDoc regime.'
required: true
report-page:
description: 'Enable or disable the generation of report page.'
required: false
default: 'true'
verbose-logging:
description: 'Enable or disable verbose logging.'
required: false
default: 'false'
# LivDoc-regime action inputs
liv-doc-repositories:
description: 'JSON string defining the repositories to be included in the documentation generation.'
required: false
default: '[]'
liv-doc-project-state-mining:
description: 'Enable or disable mining of project state data.'
required: false
default: 'false'
liv-doc-structured-output:
description: 'Enable or disable structured output.'
required: false
default: 'false'
liv-doc-group-output-by-topics:
description: 'Enable or disable grouping tickets by topics in the summary index.md file.'
required: false
default: 'false'
outputs:
output-path:
description: 'Path to the generated living documentation files.'
value: ${{ steps.liv-doc-generator.outputs.output-path }}
branding:
icon: 'book'
color: 'yellow'
runs:
using: 'composite'
steps:
- name: Install Python dependencies
run: |
pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- name: Set PROJECT_ROOT and update PYTHONPATH
run: |
ACTION_ROOT="${{ github.action_path }}"
export PYTHONPATH="${PYTHONPATH}:${ACTION_ROOT}/living-doc-generator"
shell: bash
- name: Prepare environment based on mining regimes
run: |
# Set base env variables common for all regimes
echo "INPUT_GITHUB_TOKEN=${{ env.GITHUB-TOKEN }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_REGIME=${{ inputs.liv-doc-regime }}" >> $GITHUB_ENV
echo "INPUT_REPORT_PAGE=${{ inputs.report-page }}" >> $GITHUB_ENV
echo "INPUT_VERBOSE_LOGGING=${{ inputs.verbose-logging }}" >> $GITHUB_ENV
# Add LivDoc-specific env variables if the regime is enabled
if [[ "${{ inputs.liv-doc-regime }}" == "true" ]]; then
echo "INPUT_LIV_DOC_REPOSITORIES=$(echo '${{ inputs.liv-doc-repositories }}' | jq -c .)" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_PROJECT_STATE_MINING=${{ inputs.liv-doc-project-state-mining }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_STRUCTURED_OUTPUT=${{ inputs.liv-doc-structured-output }}" >> $GITHUB_ENV
echo "INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS=${{ inputs.liv-doc-group-output-by-topics }}" >> $GITHUB_ENV
fi
shell: bash
- name: Run Living Documentation Generator
id: liv-doc-generator
env:
INPUT_GITHUB_TOKEN: ${{ env.INPUT_GITHUB_TOKEN }}
INPUT_LIV_DOC_REGIME: ${{ env.INPUT_LIV_DOC_REGIME }}
INPUT_REPORT_PAGE: ${{ env.INPUT_REPORT_PAGE }}
INPUT_VERBOSE_LOGGING: ${{ env.INPUT_VERBOSE_LOGGING }}
INPUT_LIV_DOC_REPOSITORIES: ${{ env.INPUT_LIV_DOC_REPOSITORIES }}
INPUT_LIV_DOC_PROJECT_STATE_MINING: ${{ env.INPUT_LIV_DOC_PROJECT_STATE_MINING }}
INPUT_LIV_DOC_STRUCTURED_OUTPUT: ${{ env.INPUT_LIV_DOC_STRUCTURED_OUTPUT }}
INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS: ${{ env.INPUT_LIV_DOC_GROUP_OUTPUT_BY_TOPICS }}
run: |
python ${{ github.action_path }}/main.py
shell: bash