Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
p-miano committed Oct 10, 2024
1 parent c0012c3 commit 8d74ba7
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/update_repo_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ jobs:
echo "Languages extracted and saved to JSON file:"
cat repo_data.json
# Step EXTRA: Log JSON File Contents Before Commit
- name: Log JSON File Contents
run: |
echo "Contents of repo_data.json before attempting to commit:"
cat repo_data.json
# Step 5: Remove the untracked JSON file if it exists
- name: Remove Untracked JSON File
run: |
Expand All @@ -74,29 +80,30 @@ jobs:
rm repo_data.json
fi
# Step EXTRA: Log JSON File Contents Before Commit
- name: Log JSON File Contents
run: |
echo "Contents of repo_data.json before attempting to commit:"
cat repo_data.json
# Step 6: Checkout gh-pages branch
- name: Checkout gh-pages Branch
run: |
git fetch
git checkout gh-pages
# Step EXTRA: Log JSON File Contents Before Commit
- name: Log JSON File Contents
# Step EXTRA: Log JSON File Contents After Checkout Branch
- name: Log JSON File Contents After Checkout
run: |
echo "Contents of repo_data.json before attempting to commit:"
cat repo_data.json
if [ -f repo_data.json ]; then
echo "Contents of repo_data.json after switching to gh-pages branch:"
cat repo_data.json
else
echo "repo_data.json not found after switching branches."
fi
# Step 7: Commit the JSON file to gh-pages branch
- name: Commit JSON File
run: |
git add repo_data.json
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update repository languages data [skip ci]" || echo "No changes to commit"
git push origin gh-pages
if [ -f repo_data.json ]; then
git add repo_data.json
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Update repository languages data [skip ci]" || echo "No changes to commit"
git push origin gh-pages
else
echo "repo_data.json not found, nothing to commit."

0 comments on commit 8d74ba7

Please sign in to comment.