-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.83 KB
/
Copy pathstamp-version.yml
File metadata and controls
50 lines (47 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Stamp QEP version
on:
push:
branches: [main]
paths:
- "qeps/**"
# Needs write access to push the stamp/sync commit back to main.
permissions:
contents: write
# Serialise stamp runs so two QEP merges in quick succession don't race on the
# push to main (the later push would otherwise be rejected non-fast-forward).
concurrency:
group: stamp-main
cancel-in-progress: false
jobs:
stamp:
# The bot's own commit carries [skip-stamp]; pushes made with GITHUB_TOKEN
# don't retrigger workflows anyway, so this guard is belt-and-suspenders.
# That same no-retrigger behaviour means this push does not redeploy the
# site — which is fine: everything visible (the type/version pills and the
# README columns) is already correct from the merge commit, and only the
# invisible `version-hash` field waits for the next push to main to republish.
if: ${{ !contains(github.event.head_commit.message, '[skip-stamp]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: Stamp hash and sync README
run: node .github/scripts/stamp.mjs
- name: Commit and push if changed
run: |
if git diff --quiet; then
echo "Nothing to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Stamp QEP version hash and sync README [skip-stamp]"
# Rebase onto anything that landed on main while we were stamping,
# then push, so a near-simultaneous merge can't drop this stamp.
git pull --rebase origin main
git push origin HEAD:main