Skip to content

ci: restore master and keep it synced to main automatically - #79

Merged
stephenstack merged 1 commit into
mainfrom
DEV-RCO-1449-master-note
Sep 12, 2026
Merged

stephenstack merged 1 commit into
mainfrom
DEV-RCO-1449-master-note

Conversation

@stephenstack

@stephenstack stephenstack commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

What happened

The master branch was deleted after the rename to main. It has been recreated from main and now points at the same commit, so old links work again.

Why it has to exist

Older documentation, bookmarks and raw file URLs still reference it:

https://raw.githubusercontent.com/rconfig/rConfig-templates/master/cisco/cisco-ios-ssh-enable.yml

Every one of those breaks without the branch.

Why it has to stay in sync

An unsynced master is worse than a missing one. The old links keep working but quietly serve stale templates, so someone following a year-old doc gets something that looks current and is not. That fails silently, which is the hard kind to notice.

The workflow

.github/workflows/sync-master.yml fast-forwards master whenever main moves.

Triggered on push to main, not on pull_request. A pull_request trigger fires while the PR is open, before the merge, when main has not moved yet. Push-to-main fires on the merge itself, which is the moment that matters. workflow_dispatch is there for a manual re-run.

The push is deliberately not forced. git refuses a non-fast-forward by default, so this can only move master forward along main's history. If someone has committed directly to master, the push is rejected and the job fails loudly with a message saying so, rather than force-pushing their work away. That is the failure mode I would rather have: a red check beats silent data loss.

A concurrency group, so two merges landing close together cannot race and leave master on the older of the two.

A verification step re-fetches both refs afterwards and fails if they do not match, so the job cannot report success while leaving them apart.

Verified

Both paths exercised against a throwaway local remote:

Case Result
main moves ahead, master is an ancestor push succeeds, master fast-forwards
A commit made directly to master push rejected, job would fail loudly

Workflow YAML parses. Validator unaffected: 79 templates, 0 errors, 2 pre-existing warnings.

README

The Branches section now describes the automation rather than telling people to remember a manual step, and keeps the one-liner for seeding the branch if it is ever deleted again.

🤖 Generated with Claude Code

The repository was renamed from master to main, but older documentation,
bookmarks and raw file URLs still point at .../rConfig-templates/master/...
Deleting the branch breaks every one of those links, so it has been
recreated from main.

Documents that it carries no unique work, that nothing should branch from
it or merge into it, and how to resync it. Left unsynced it is worse than
absent: the old links keep working while quietly serving stale templates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@stephenstack
stephenstack merged commit 68aa04c into main Sep 12, 2026
2 checks passed
@stephenstack stephenstack changed the title docs: restore master as a mirror of main and say why it stays ci: restore master and keep it synced to main automatically Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants