11name : " Graph Git Repo"
22description : " Generates a repository structure and Mermaid diagram using ChatGPT, uploads them as artifacts, and optionally creates a PR."
3- author : " github-actions[bot]"
43inputs :
54 exclude_patterns :
65 description : ' Patterns to exclude (e.g., ".git|*.log|node_modules")'
@@ -15,7 +14,13 @@ inputs:
1514 required : false
1615 default : ' false'
1716 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+
1924runs :
2025 using : " composite"
2126 steps :
2934
3035 - name : Install Tree Command
3136 run : sudo apt-get install -y tree
37+ shell : bash
3238
3339 - name : Generate Repo Structure
3440 run : |
@@ -43,11 +49,13 @@ runs:
4349
4450 - name : Install Python dependencies
4551 run : pip install openai
52+ shell : bash
4653
4754 - name : Generate Mermaid Diagram using ChatGPT
4855 env :
49- OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
56+ OPENAI_API_KEY : ${{ inputs.openai_api_key }}
5057 run : python ${{ github.action_path }}/tree_to_gpt.py
58+ shell : bash
5159
5260 - name : Upload Generated Files as Artifacts
5361 uses : actions/upload-artifact@v3
@@ -73,11 +81,10 @@ runs:
7381 author : github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7482 title : " Update repository structure and Mermaid diagram"
7583 branch : update-repo-structure-${{ github.run_id }}
76- labels : " automated-update "
84+ labels : " graph-git-repo "
7785 env :
78- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86+ GITHUB_TOKEN : ${{ inputs.github_token }}
7987
8088branding :
8189 icon : " git-merge"
8290 color : " blue"
83-
0 commit comments