Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/workflows/sync-from-source-of-truth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
# Default is substituted by quick-setup.sh at install time. Operator
# bumps it via PR or by re-running quick-setup with a newer
# --source-ref. Manual dispatch can override per-run.
default: 'v0.2.5'
default: 'v0.3.1'
type: string

jobs:
Expand Down Expand Up @@ -75,22 +75,22 @@ jobs:
run: |
# Resolution order:
# 1. workflow_dispatch input (operator override per-run)
# 2. workflow_call default (v0.2.5, substituted by quick-setup
# 2. workflow_dispatch input default (substituted by quick-setup
# at install time, bumped via PR thereafter)
SOURCE_REF="${{ github.event.inputs.source_ref || 'v0.2.5' }}"
SOURCE_REF="${{ github.event.inputs.source_ref || 'v0.3.1' }}"

# Immutability + substitution-check in one regex pair. source_ref
# must be a pinned tag (vN.N.N pattern) or full 40-char SHA. Branch
# names (main, master, dev) and the unsubstituted 'v0.2.5'
# token both fail this check. A separate unsubstituted-token guard
# used to live above, but quick-setup.sh substitutes 'v0.2.5'
# names (main, master, dev) and an unsubstituted default token
# both fail this check. A separate unsubstituted-token guard
# used to live above, but quick-setup.sh substitutes the default
# globally including inside that guard's literal — which made the
# guard self-rejecting post-substitution. Dropped; the regex below
# catches the same condition correctly.
if [[ ! "${SOURCE_REF}" =~ ^[0-9a-f]{40}$ ]] && \
[[ ! "${SOURCE_REF}" =~ ^v?[0-9]+(\.[0-9]+){1,2}([.-][0-9A-Za-z._-]+)?$ ]]; then
echo "ERROR: source_ref must be a pinned tag (e.g. v1.2.3) or full 40-char SHA." >&2
echo "Got: '${SOURCE_REF}'. Branch names and the unsubstituted 'v0.2.5' token are not accepted." >&2
echo "Got: '${SOURCE_REF}'. Branch names and unsubstituted default tokens are not accepted." >&2
echo "If you see the literal token, re-run scripts/quick-setup.sh from gominimal/min-aw at a pinned ref." >&2
exit 1
fi
Expand Down Expand Up @@ -130,6 +130,20 @@ jobs:

chmod +x sync-workflows.sh

- name: Configure git author for the sync commit
if: steps.app_config.outputs.available == 'true'
run: |
# sync-workflows.sh creates a chore branch and commits the synced
# files. The runner has no default git identity, so the commit step
# exits 128 with `empty ident name` unless we configure it here.
# Use the canonical github-actions[bot] noreply form including the
# numeric user-id prefix so GitHub attributes the commit to the bot
# account in UI/API. Patched in from gominimal/min-aw v0.3.1;
# subsequent sync runs (or a re-install via quick-setup at that
# version or later) will carry the same step in the wrapper template.
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Run sync-workflows.sh
if: steps.app_config.outputs.available == 'true'
run: |
Expand Down
Loading