@@ -15,13 +15,14 @@ jobs:
1515 uses : actions/checkout@v3
1616 with :
1717 token : ${{ secrets.MY_GITHUB_TOKEN }}
18+ # Add this to fetch all history for proper merging
19+ fetch-depth : 0
1820
1921 - name : Create data directory
2022 run : |
21- # Create _data directory and show results
23+ # Create _data directory with exact name (no asterisks)
2224 mkdir -p _data
23- echo "Created _data directory:"
24- ls -la | grep _data
25+ echo "Created _data directory"
2526
2627 - name : Generate Repository Summaries
2728 uses : gojiplus/generator@v3
@@ -32,36 +33,20 @@ jobs:
3233
3334 - name : Copy output file
3435 run : |
35- # Verify _data directory exists
36- if [ ! -d "_data" ]; then
37- echo "Creating _data directory again"
38- mkdir -p _data
39- fi
40-
41- # Copy the file with verbose output
36+ # Copy to the proper directory (no asterisks)
4237 cp -v repo_summaries.json _data/generated_data.json
43-
44- # Verify the file was copied
45- ls -la _data/
4638
4739 - name : Commit and push changes
4840 run : |
4941 git config --global user.name "GitHub Actions Bot"
5042 git config --global user.email "[email protected] " 5143
52- # Verify file exists before adding
53- if [ ! -f "_data/generated_data.json" ]; then
54- echo "ERROR: Output file not found!"
55- exit 1
56- fi
44+ # Pull latest changes first to resolve conflicts
45+ git pull origin main
5746
58- # Add and commit the file
47+ # Add the file with proper path (no asterisks)
5948 git add _data/generated_data.json
6049
61- # Check if there are changes to commit
62- if git diff --staged --quiet; then
63- echo "No changes to commit"
64- else
65- git commit -m "Auto-update repository summary data"
66- git push
67- fi
50+ # Commit and push with conflict resolution
51+ git diff --staged --quiet || git commit -m "Auto-update repository summary data"
52+ git push
0 commit comments