Skip to content

fix: add force_push and fetch-depth: 0#16

Merged
thedavidweng merged 1 commit into
mainfrom
fix/mirror-v2
Jun 20, 2026
Merged

fix: add force_push and fetch-depth: 0#16
thedavidweng merged 1 commit into
mainfrom
fix/mirror-v2

Conversation

@thedavidweng

Copy link
Copy Markdown
Owner

Fix mirror workflow.

@thedavidweng thedavidweng merged commit 958a29e into main Jun 20, 2026
1 check failed
@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes the mirror workflow by adding fetch-depth: 0 to the checkout step and enabling force_push on the mirror action, both of which are required for a correct full-history mirror to Codeberg.

  • fetch-depth: 0: Without this, actions/checkout performs a shallow clone (depth 1), so only the latest commit is available. The mirror action would then fail to push the complete history, branches, and tags to Codeberg.
  • force_push: true: Allows the mirror action to overwrite the Codeberg remote when it diverges from the source (e.g., after upstream rebases or force-pushes), preventing sync failures.

Confidence Score: 5/5

Safe to merge — the two additions are minimal, targeted, and correct for a full-history mirror workflow.

Both changes directly fix the mirror workflow: the shallow checkout was preventing the mirror action from seeing the full branch and tag history, and without force_push the action would stall whenever the remote had drifted. The workflow already pins both action SHAs and uses a secret for the token. No unintended side effects are introduced.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/mirror.yml Adds fetch-depth: 0 for full history checkout and force_push: true for the mirror action — both are correct and necessary for a complete mirror workflow.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant GH as GitHub (source)
    participant Runner as GitHub Actions Runner
    participant CB as Codeberg (mirror)

    GH->>Runner: push / workflow_dispatch event
    Runner->>GH: actions/checkout (fetch-depth: 0)
    Note over Runner: Full history + all branches/tags fetched
    GH-->>Runner: Complete git history
    Runner->>CB: cssnr/mirror-repository-action (force_push: true)
    Note over CB: All refs overwritten to match source
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant GH as GitHub (source)
    participant Runner as GitHub Actions Runner
    participant CB as Codeberg (mirror)

    GH->>Runner: push / workflow_dispatch event
    Runner->>GH: actions/checkout (fetch-depth: 0)
    Note over Runner: Full history + all branches/tags fetched
    GH-->>Runner: Complete git history
    Runner->>CB: cssnr/mirror-repository-action (force_push: true)
    Note over CB: All refs overwritten to match source
Loading

Reviews (1): Last reviewed commit: "fix: add force_push and fetch-depth: 0" | Re-trigger Greptile

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.

1 participant