Skip to content

Commit

Permalink
Tried to fix the repo file path
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrohanea committed Nov 10, 2024
1 parent 8507ad5 commit bd0bf1f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/collect-gpt-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
repo = os.getenv('GITHUB_REPOSITORY')
token = os.getenv('GITHUB_TOKEN')
headers = {'Authorization': f'token {token}'}
repo_root = os.getenv('GITHUB_WORKSPACE')
# Collect issues
issues = []
page = 1
Expand Down Expand Up @@ -94,11 +95,17 @@ jobs:
with open('code_snippets.md', 'w') as f:
for file_path in important_files:
f.write(f"## {file_path}\n")
with open(file_path, 'r', encoding='utf-8') as code_file:
f.write("```csharp\n")
f.write(code_file.read())
f.write("\n```\n\n")
f.write(f"## {file_path}\n")
full_path = os.path.join(repo_root, file_path)
if os.path.exists(full_path):
with open(full_path, 'r', encoding='utf-8') as code_file:
f.write("```csharp\n")
f.write(code_file.read())
f.write("\n```\n\n")
else:
f.write("```csharp\n")
f.write("// File not found.\n")
f.write("```\n\n")
EOF
Expand Down

0 comments on commit bd0bf1f

Please sign in to comment.