File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 77
88permissions :
99 contents : write
10+ pull-requests : write
1011
1112jobs :
1213 update-date :
1314 runs-on : ubuntu-latest
1415
1516 steps :
16- - name : Checkout repository
17+ - name : Checkout PR branch
1718 uses : actions/checkout@v4
1819 with :
1920 fetch-depth : 0
21+ ref : ${{ github.event.pull_request.head.ref }}
2022
2123 - name : Set up Python
2224 uses : actions/setup-python@v4
3436 - name : Update last modified date in Markdown files
3537 run : python .github/workflows/update_date.py
3638
37- - name : Commit changes
39+ - name : Pull (merge) remote changes, commit, and push if needed
40+ env :
41+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
3842 run : |
43+ BRANCH="${{ github.event.pull_request.head.ref }}"
44+ git pull origin "$BRANCH" || echo "No merge needed"
3945 git add -A
4046 git commit -m "Update last modified date in Markdown files" || echo "No changes to commit"
41- git push origin HEAD:${{ github.event.pull_request.head.ref }}
47+ git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
48+ git push origin HEAD:"$BRANCH"
You can’t perform that action at this time.
0 commit comments