-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (139 loc) · 6.67 KB
/
process-analysis-doc.yml
File metadata and controls
163 lines (139 loc) · 6.67 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Process Analysis Report Generator
on:
workflow_dispatch:
inputs:
process_name:
description: 'Name of the process to analyze'
required: true
default: 'Process Analysis'
process_data:
description: 'Process data and context for analysis'
required: true
analysis_type:
description: 'Type of analysis to perform'
required: false
default: 'standard'
type: choice
options:
- standard
- detailed
- summary
jobs:
generate-process-report:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-docx
- name: Generate Process Analysis Report
env:
PROCESS_NAME: ${{ inputs.process_name }}
PROCESS_DATA: ${{ inputs.process_data }}
ANALYSIS_TYPE: ${{ inputs.analysis_type }}
run: |
python << 'EOF'
from docx import Document
from docx.shared import Pt, RGBColor, Inches
from docx.enum.text import WD_ALIGN_PARAGRAPH
from datetime import datetime
import os
# Get workflow inputs from environment variables
process_name = os.environ.get('PROCESS_NAME', 'Process Analysis')
process_data = os.environ.get('PROCESS_DATA', '')
analysis_type = os.environ.get('ANALYSIS_TYPE', 'standard')
# Create document
doc = Document()
# Set default font to Calibri
style = doc.styles['Normal']
font = style.font
font.name = 'Calibri'
font.size = Pt(11)
# Add header with professional branding
header_section = doc.sections[0]
header = header_section.header
header_para = header.paragraphs[0]
header_para.text = 'GitHub Process Manager | Process Documentation - GitHub Actions Generated'
header_para.alignment = 2 # Right align
header_run = header_para.runs[0]
header_run.font.size = Pt(10)
header_run.font.color.rgb = RGBColor(74, 144, 226) # Professional blue #4A90E2
# Add title
title = doc.add_heading('Process Analysis Report', 0)
title.alignment = 1 # Center
title_run = title.runs[0]
title_run.font.color.rgb = RGBColor(74, 144, 226)
title_run.font.size = Pt(18)
# Add process name
process_heading = doc.add_heading(process_name, level=2)
process_heading.alignment = 1 # Center
doc.add_paragraph()
# Add metadata
info_para = doc.add_paragraph()
info_para.add_run(f"Generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}\n").bold = True
info_para.add_run(f"Analysis Type: {analysis_type.title()}\n").bold = True
info_para.add_run(f"Source: GitHub Actions Workflow\n").bold = True
doc.add_paragraph('_' * 80)
doc.add_paragraph()
# Add sections (generic structure that works for SOX, MLOps, DevOps, etc.)
sections = [
('1. Overview',
'This section provides an overview of the process, its objectives, and scope.'),
('2. Key Components',
'• Component 1: Primary process elements\n• Component 2: Supporting infrastructure\n• Component 3: Integration points'),
('3. Procedures',
'1. Step-by-step process execution\n2. Quality checks and validation points\n3. Documentation and evidence collection\n4. Review and approval steps\n5. Monitoring and continuous improvement'),
('4. Analysis Results',
f'Analysis Type: {analysis_type.title()}\n\nProcess Data Analyzed:\n{process_data}\n\nFindings:\n• Sample size: To be determined based on requirements\n• Observations: To be documented during analysis\n• Process effectiveness: To be assessed upon completion'),
('5. Conclusion and Recommendations',
'This report provides the framework for process analysis. Actual results and conclusions should be documented based on specific analysis performed. Recommendations will be provided based on findings.')
]
for section_title, section_content in sections:
heading = doc.add_heading(section_title, level=1)
heading_run = heading.runs[0]
heading_run.font.color.rgb = RGBColor(74, 144, 226)
heading_run.font.size = Pt(14)
doc.add_paragraph(section_content)
doc.add_paragraph()
# Add footer
footer_section = doc.sections[0]
footer = footer_section.footer
footer_para = footer.paragraphs[0]
footer_para.text = 'Page | Confidential | Generated by GitHub Actions'
footer_para.alignment = 1 # Center
footer_run = footer_para.runs[0]
footer_run.font.size = Pt(9)
footer_run.font.color.rgb = RGBColor(128, 128, 128)
# Save document
safe_name = ''.join(c for c in process_name if c.isalnum() or c in (' ', '_')).replace(' ', '_')
filename = f'Process_Analysis_{safe_name}_{datetime.now().strftime("%Y%m%d_%H%M%S")}.docx'
doc.save(filename)
print(f"✅ Generated: {filename}")
# Save filename for next step
with open('report_filename.txt', 'w') as f:
f.write(filename)
EOF
- name: Get report filename
id: get_filename
run: echo "filename=$(cat report_filename.txt)" >> $GITHUB_OUTPUT
- name: Upload Process Report Artifact
uses: actions/upload-artifact@v4
with:
name: process-report
path: ${{ steps.get_filename.outputs.filename }}
retention-days: 7
- name: Summary
run: |
echo "## ✅ Process Analysis Report Generated" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Process Name:** ${{ inputs.process_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Analysis Type:** ${{ inputs.analysis_type }}" >> $GITHUB_STEP_SUMMARY
echo "**Timestamp:** $(date -u)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📄 Download the Word document from the **Artifacts** section above." >> $GITHUB_STEP_SUMMARY