Skip to content

Commit 34a9177

Browse files
committed
ci: notify TechEngine to bump TechAPI submodule on push to main
Reverse/sender half of the cross-repo submodule autosync (mirror of bump-engine.yml). On a real push to main, fires a repository_dispatch (techapi-updated) so TechEngine bumps its TechAPI submodule pointer. Loop guard: paths-ignore the TechEngine gitlink so the bump commits made by bump-engine.yml do not re-trigger a ping-pong. Dormant until the ENGINE_TOKEN secret (Contents write on GetTechAPI/TechEngine) is set: warns and skips instead of failing when absent.
1 parent 75d2a7a commit 34a9177

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: notify-engine
2+
3+
# Reverse direction of bump-engine: on every *real* push to main, tell
4+
# TechEngine to bump its TechAPI submodule pointer to this commit. This mirrors
5+
# TechEngine's notify-techapi.yml (which points the other way).
6+
#
7+
# Loop guard: skip pushes that ONLY move the TechEngine submodule gitlink —
8+
# those are bump-engine.yml's own commits. Without this, the two repos would
9+
# ping-pong bump commits forever. (For full symmetry TechEngine's notify-techapi
10+
# should likewise paths-ignore its TechAPI gitlink.)
11+
#
12+
# Token: needs a PAT with Contents:write on GetTechAPI/TechEngine, stored as the
13+
# ENGINE_TOKEN secret. Until that secret exists this workflow is dormant — it
14+
# logs a warning and skips the dispatch instead of failing the run.
15+
on:
16+
push:
17+
branches: [main]
18+
paths-ignore:
19+
- "TechEngine"
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
notify:
26+
runs-on: ubuntu-latest
27+
env:
28+
ENGINE_TOKEN: ${{ secrets.ENGINE_TOKEN }}
29+
steps:
30+
- name: Dormant when ENGINE_TOKEN is unset
31+
if: env.ENGINE_TOKEN == ''
32+
run: echo "::warning::ENGINE_TOKEN not configured — reverse autosync dormant; skipping dispatch."
33+
34+
- name: Dispatch techapi-updated to TechEngine
35+
if: env.ENGINE_TOKEN != ''
36+
uses: peter-evans/repository-dispatch@v3
37+
with:
38+
token: ${{ secrets.ENGINE_TOKEN }}
39+
repository: GetTechAPI/TechEngine
40+
event-type: techapi-updated
41+
client-payload: |
42+
{"sha": "${{ github.sha }}", "ref": "${{ github.ref }}"}

0 commit comments

Comments
 (0)