1
1
name : " Graph Git Repo"
2
2
description : " Generates a repository structure and Mermaid diagram using ChatGPT, uploads them as artifacts, and optionally creates a PR."
3
- author : " github-actions[bot]"
4
3
inputs :
5
4
exclude_patterns :
6
5
description : ' Patterns to exclude (e.g., ".git|*.log|node_modules")'
@@ -15,7 +14,13 @@ inputs:
15
14
required : false
16
15
default : ' false'
17
16
type : boolean
18
-
17
+ openai_api_key :
18
+ description : ' OpenAI API key for generating diagrams'
19
+ required : true
20
+ github_token :
21
+ description : ' GitHub token for authentication'
22
+ required : true
23
+
19
24
runs :
20
25
using : " composite"
21
26
steps :
29
34
30
35
- name : Install Tree Command
31
36
run : sudo apt-get install -y tree
37
+ shell : bash
32
38
33
39
- name : Generate Repo Structure
34
40
run : |
@@ -43,11 +49,13 @@ runs:
43
49
44
50
- name : Install Python dependencies
45
51
run : pip install openai
52
+ shell : bash
46
53
47
54
- name : Generate Mermaid Diagram using ChatGPT
48
55
env :
49
- OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
56
+ OPENAI_API_KEY : ${{ inputs.openai_api_key }}
50
57
run : python ${{ github.action_path }}/tree_to_gpt.py
58
+ shell : bash
51
59
52
60
- name : Upload Generated Files as Artifacts
53
61
uses : actions/upload-artifact@v3
@@ -73,11 +81,10 @@ runs:
73
81
author : github-actions[bot] <github-actions[bot]@users.noreply.github.com>
74
82
title : " Update repository structure and Mermaid diagram"
75
83
branch : update-repo-structure-${{ github.run_id }}
76
- labels : " automated-update "
84
+ labels : " graph-git-repo "
77
85
env :
78
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86
+ GITHUB_TOKEN : ${{ inputs.github_token }}
79
87
80
88
branding :
81
89
icon : " git-merge"
82
90
color : " blue"
83
-
0 commit comments