Add Gitea workflow to sync runner checkout on master changes.
Sync runner checkout / sync (pull_request) Successful in 5s

Keeps ~/Documents/repos/server-infra on the Act runner up to date after
direct pushes and merged PRs so CI deploy steps use current playbooks.
This commit is contained in:
2026-07-11 11:49:38 -05:00
parent 974e848d91
commit ec64464205
2 changed files with 41 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
name: Sync runner checkout
on:
push:
branches: [master]
pull_request:
types: [closed]
branches: [master]
jobs:
sync:
if: gitea.event_name == 'push' || gitea.event.pull_request.merged == true
runs-on: self-hosted
steps:
- name: Pull latest server-infra
run: |
set -euo pipefail
REPO="/home/westfarn/Documents/repos/server-infra"
if [[ ! -d "${REPO}/.git" ]]; then
echo "Missing git checkout at ${REPO}"
exit 1
fi
cd "${REPO}"
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "Working tree is dirty; refusing to pull"
git status --short
exit 1
fi
git fetch origin master
git checkout master
git pull --ff-only origin master
git rev-parse --short HEAD