Conversation
Contributor
There was a problem hiding this comment.
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.actorisdependabot[bot]. - Add a Dependabot push detector workflow intended to act as a
workflow_runtrigger. - 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) }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ECC-8262: Fix mirror workflow for Dependabot pushes
When Dependabot pushes a dependency update, GitHub restricts the job to
Secret source: Dependabotwith read-only permissions — theBITBUCKET_ACCESS_TOKENsecret is not available. This causes the mirror to fail silently on every Dependabot commit.Changes
mirror-repository.yaml: addedif: 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 belowmirror-repository-dependabot.yaml(new): triggered viaworkflow_runfrom the beacon — runs in the main repo context whereBITBUCKET_ACCESS_TOKENis available, performs the actual mirrorThis is the same pattern already used in
corvina-backend.