Skip to content

Commit 703921a

Browse files
committed
ci: tighten last_modified workflow
1 parent b8044d0 commit 703921a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/update-last-modified.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update last_modified
1+
name: Update last_modified
22

33
on:
44
pull_request:
@@ -11,8 +11,13 @@ on:
1111
paths:
1212
- "_articles/faq/*.md"
1313

14+
concurrency:
15+
group: update-last-modified-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
1418
permissions:
1519
contents: write
20+
pull-requests: read
1621

1722
jobs:
1823
update-on-master-pr:
@@ -45,7 +50,7 @@ jobs:
4550
shell: bash
4651
run: |
4752
set -euo pipefail
48-
timestamp="$(date '+%Y-%m-%d %H:%M:%S %z')"
53+
timestamp="$(TZ=UTC date '+%Y-%m-%d %H:%M:%S +0000')"
4954
5055
while IFS= read -r file; do
5156
[[ -f "$file" ]] || continue
@@ -87,4 +92,5 @@ jobs:
8792
git add "$file"
8893
done < changed_files.txt
8994
git commit -m "chore: update last_modified timestamps"
95+
git pull --rebase origin "${{ github.event.pull_request.head.ref }}"
9096
git push origin HEAD:${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)