File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1414 - uses : actions/checkout@v4
1515 with :
1616 token : ${{ secrets.GITHUB_TOKEN }}
17+ fetch-depth : 0
1718
1819 - name : Set up Python
1920 uses : actions/setup-python@v5
@@ -33,11 +34,17 @@ jobs:
3334 echo "changed=true" >> $GITHUB_OUTPUT
3435 fi
3536
36- - name : Commit changes
37+ - name : Commit and push changes
3738 if : steps.verify-changed-files.outputs.changed == 'true'
3839 run : |
3940 git config --local user.email "action@github.com"
4041 git config --local user.name "GitHub Action"
4142 git add README.md
4243 git commit -m "docs: update problem count badges [skip ci]"
43- git push
44+
45+ # Get the correct branch name for pushing
46+ BRANCH_NAME="${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}"
47+ echo "Pushing to branch: $BRANCH_NAME"
48+
49+ # Push to the correct branch
50+ git push origin HEAD:$BRANCH_NAME
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def update_readme_badges(cpp_count, python_count):
5656
5757 # Define the new badge lines
5858 cpp_badge = f"[](https://github.com/mathusanm6/LeetCode/tree/main/problems)"
59- python_badge = f"[](https://github.com/mathusanm6/LeetCode/tree/main/problems)"
59+ python_badge = f"[](https://github.com/mathusanm6/LeetCode/tree/main/problems)"
6060
6161 # Update C++ badge
6262 cpp_pattern = r"\[\!\[C\+\+ Solutions\].*?\)\]\(.*?\)"
You can’t perform that action at this time.
0 commit comments