Skip to content

ECC-8262: fix mirror workflow for Dependabot pushes#35

Closed
pisto wants to merge 1 commit into
masterfrom
ECC-8262
Closed

ECC-8262: fix mirror workflow for Dependabot pushes#35
pisto wants to merge 1 commit into
masterfrom
ECC-8262

Conversation

@pisto
Copy link
Copy Markdown

@pisto pisto commented May 26, 2026

ECC-8262: Fix mirror workflow for Dependabot pushes

When Dependabot pushes a dependency update, GitHub restricts the job to Secret source: Dependabot with read-only permissions — the BITBUCKET_ACCESS_TOKEN secret is not available. This causes the mirror to fail silently on every Dependabot commit.

Changes

  • mirror-repository.yaml: added if: github.actor != 'dependabot[bot]' to skip the job when Dependabot triggers it (it would fail anyway — this prevents the spurious failure)
  • dependabot-push.yaml (new): beacon workflow that runs on Dependabot pushes and completes successfully, triggering the privileged workflow below
  • mirror-repository-dependabot.yaml (new): triggered via workflow_run from the beacon — runs in the main repo context where BITBUCKET_ACCESS_TOKEN is available, performs the actual mirror

This is the same pattern already used in corvina-backend.

Copilot AI review requested due to automatic review settings May 26, 2026 14:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the repository mirroring GitHub Actions workflows to avoid Dependabot’s restricted secret context by skipping the original mirroring job on Dependabot pushes and introducing a two-step “beacon + privileged workflow_run” pattern to perform the mirror with secrets available.

Changes:

  • Skip the existing mirror job when github.actor is dependabot[bot].
  • Add a Dependabot push detector workflow intended to act as a workflow_run trigger.
  • Add a workflow_run-triggered mirror workflow intended to run with secrets available and push to Bitbucket.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/mirror-repository.yaml Skips the existing mirror job for Dependabot-triggered pushes.
.github/workflows/dependabot-push.yaml Adds a “beacon” workflow intended to complete on Dependabot pushes.
.github/workflows/mirror-repository-dependabot.yaml Adds a workflow_run mirror workflow intended to run with secrets and perform the Bitbucket mirror.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

name: Mirror repository (with secrets)
runs-on: ubuntu-24.04
if: >
github.event.workflow_run.actor == 'dependabot[bot]'
Comment on lines +3 to +8
on:
workflow_run:
workflows:
- Dependabot Push Detector
types:
- completed
Comment on lines +10 to +13
steps:
- run: echo "Dependabot PR validated"
- name: Debug workflow_run event
run: echo "${{ toJson(github.event.workflow_run) }}"
@pisto pisto closed this May 26, 2026
@pisto pisto deleted the ECC-8262 branch May 26, 2026 17:32
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