Skip to content

fix: openai_api_key

fix: openai_api_key #5

name: graph-git-repo
on:
push:
branches:
- main
workflow_dispatch:
inputs:
exclude_patterns:
description: 'Patterns to exclude (e.g., ".git|*.log|node_modules")'
required: false
default: '.git|.DS_Store|.idea|*.log|*.tmp|__pycache__'
depth:
description: 'tree depth to consider'
required: false
default: '2'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Tree Command
run: sudo apt-get install -y tree
- name: Generate Repo Structure
run: |
chmod +x base.sh
bash base.sh '${{ github.event.inputs.exclude_patterns }}' '${{ github.event.inputs.depth }}'
shell: bash
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Python dependencies
run: pip install openai
- name: Generate Mermaid Diagram using ChatGPT
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: python tree_to_gpt.py
- name: Commit Changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add REPO_STRUCTURE.md MERMAID_DIAGRAM.md
git commit -m "[bot] Update repository structure and Mermaid diagram"
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
title: "Update repository structure and Mermaid diagram"
branch: update-repo-structure
labels: "automated-update"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}