File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 1818 uses : actions/checkout@v4
1919 with :
2020 fetch-depth : 0
21+ ref : ${{ github.head_ref || github.ref_name }}
2122
2223 - name : Set up Node.js
2324 uses : actions/setup-node@v3
@@ -35,12 +36,23 @@ jobs:
3536 git config --global user.email "github-actions[bot]@users.noreply.github.com"
3637 git config --global user.name "github-actions[bot]"
3738
38- - name : Commit and rebase changes
39+ - name : Commit and merge changes
3940 env :
4041 PR_BRANCH : ${{ github.head_ref || github.ref_name }}
42+ GIT_AUTHOR_NAME : github-actions[bot]
43+ GIT_AUTHOR_EMAIL : github-actions[bot]@users.noreply.github.com
44+ GIT_COMMITTER_NAME : github-actions[bot]
45+ GIT_COMMITTER_EMAIL : github-actions[bot]@users.noreply.github.com
4146 run : |
42- git pull origin "$PR_BRANCH" || echo "Failed to pull latest changes"
47+ # Ensure we're on the correct branch
48+ git switch -c "$PR_BRANCH" || git switch "$PR_BRANCH"
49+
50+ # Stage and commit changes if any
4351 git add -A
44- git commit -m "Fix Markdown syntax issues" || echo "No changes to commit"
45- git pull --rebase origin "$PR_BRANCH" || echo "No rebase needed"
46- git push origin HEAD:"$PR_BRANCH"
52+ git diff --staged --quiet || git commit -m "Fix Markdown syntax issues"
53+
54+ # Pull and merge existing changes
55+ git pull origin "$PR_BRANCH" --no-rebase
56+
57+ # Push all changes
58+ git push origin "$PR_BRANCH"
You can’t perform that action at this time.
0 commit comments