Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions .github/workflows/sync-main-to-edge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is managed by nsheaps/.github (sync-files).
Comment thread
henry-nsheaps[bot] marked this conversation as resolved.
# Source: https://github.com/nsheaps/.github/blob/main/ansible/templates/.github/workflows/sync-main-to-edge.yaml
# Edit-in-place will be overwritten on the next sync.
name: Sync main to edge

on:
push:
branches: [main]
workflow_dispatch:
inputs:
test_mode:
description: 'Run in test mode (no push)'
type: boolean
default: false

permissions:
contents: write

jobs:
sync:
name: Sync main -> */edge
uses: nsheaps/github-actions/.github/workflows/sync-main-to-edge.yaml@main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ SHA-pin recommendation (answering your open question #2)

Every other nsheaps/github-actions reference in this repo is SHA-pinned with a human-readable trailing comment, e.g.:

uses: nsheaps/github-actions/.github/actions/checkout-as-app@603052841cd49b9fdc99bc32979ff9c45c9b669e # checkout-as-app@main

(see .github/workflows/ci.yaml:31, cd.yaml:58,171, claude-agent.yaml:22, claude-code-review.yaml:47, claude-agent-trigger.yaml:51, daily-report.yaml:43)

@main here is the only outlier. Worth pinning to match the convention noted in .claude/rules/ci-cd/conventions.md ("pinned to a specific commit SHA for supply chain security") once nsheaps/github-actions#24 lands and you have a concrete SHA:

Suggested change
uses: nsheaps/github-actions/.github/workflows/sync-main-to-edge.yaml@main
uses: nsheaps/github-actions/.github/workflows/sync-main-to-edge.yaml@<SHA> # sync-main-to-edge@main

Caveat: the file header notes this is sync-files–managed from nsheaps/.github. For the SHA pin to stick, the template in nsheaps/.github#63 also needs to be pinned — otherwise the next sync will revert it back to @main. If it's easier to pin the template only, that also works.

with:
test_mode: ${{ inputs.test_mode == true }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Verified the inputs.test_mode == true pattern is safe across triggers:

  • push: inputs context is empty → null == true evaluates to false (passed as false to the reusable workflow's boolean input) ✅
  • workflow_dispatch default: false == true → false ✅
  • workflow_dispatch with test_mode=true: true == true → true ✅

The reusable workflow in nsheaps/github-actions#24 declares test_mode as type: boolean, so the boolean output here lines up.

Nit-level alternative (non-blocking): ${{ inputs.test_mode || false }} is equivalent and slightly more idiomatic, but the current form is fine and arguably more explicit.

7 changes: 7 additions & 0 deletions .gitupstream
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Configures sync-main-to-edge workflow. Schema:
# https://github.com/nsheaps/github-actions/blob/main/.github/workflows/sync-main-to-edge.yaml
version: 1
sync:
- upstream: main
targets:
- alex/edge

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

↩️ Answering open question #1: pre-seeding alex/edge here is fine. I confirmed against the reusable workflow in nsheaps/github-actions#24 — the plan job builds a matrix of {upstream, target} rows and the sync action will simply no-op when a target branch doesn't exist on the remote (the marketplace action aormsby/Fork-Sync-With-Upstream-action skips missing targets).

Also worth noting: the PR body says "sync: [] as a placeholder" but the actual file has alex/edge populated — the body is slightly out of sync with the file. Either is fine in practice; just flagging the mismatch.

Schema (version: 1, sync[].upstream, sync[].targets[]) lines up with what the reusable workflow expects via yq. ✅

Loading