File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Last Modified Date
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+
8+ jobs :
9+ update-date :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+
18+ - name : Set up Python
19+ uses : actions/setup-python@v4
20+ with :
21+ python-version : ' 3.x'
22+
23+ - name : Install dependencies
24+ run : pip install python-dateutil
25+
26+ - name : Configure Git
27+ run : |
28+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
29+ git config --global user.name "github-actions[bot]"
30+
31+ - name : Update last modified date in Markdown files
32+ run : python .github/workflows/update_date.py
33+
34+ - name : Commit changes
35+ env :
36+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
37+ run : |
38+ git fetch origin
39+ git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
40+ git add -A
41+ git commit -m "Update last modified date in Markdown files" || echo "No changes to commit"
42+ git remote set-url origin https://x-access-token:${TOKEN}@github.com/${{ github.repository }}
43+ git push origin HEAD:${{ github.event.pull_request.head.ref }}
You can’t perform that action at this time.
0 commit comments