Skip to content

Add GitHub Actions workflow for syncing upstream repository#18

Open
yousef-cohere wants to merge 5 commits into
coherefrom
feat/sync-upstream-workflow
Open

Add GitHub Actions workflow for syncing upstream repository#18
yousef-cohere wants to merge 5 commits into
coherefrom
feat/sync-upstream-workflow

Conversation

@yousef-cohere
Copy link
Copy Markdown

@yousef-cohere yousef-cohere commented Apr 16, 2026

  • Introduced a new workflow sync-upstream.yaml that automates the process of syncing the main branch with an upstream repository on a scheduled basis and via manual triggers.
  • The workflow includes steps for fast-forwarding the main branch, checking for updates on the cohere branch, and creating pull requests for any new commits.
  • Enhanced error handling for merge conflicts and provided detailed instructions for conflict resolution in the generated pull requests.

Note

Medium Risk
This introduces automation that can directly push to main and create PRs, so misconfiguration or unexpected upstream changes could affect the primary branch even though the fast-forward-only guardrails reduce risk.

Overview
Adds a new GitHub Actions workflow, sync-upstream.yaml, to automate syncing main with confidential-containers/cloud-api-adaptor on a weekly cron and via manual dispatch (with configurable upstream ref and target cohere branch).

The workflow fast-forwards origin/main only when it’s strictly behind upstream (fails if main has diverged), then creates/pushes a sync/upstream-<date>-<sha> branch and opens a PR to merge into cohere, including conflict detection and tailored PR instructions when conflicts are found.

Reviewed by Cursor Bugbot for commit 5b75df5. Bugbot is set up for automated code reviews on this repo. Configure here.

- Introduced a new workflow `sync-upstream.yaml` that automates the process of syncing the main branch with an upstream repository on a scheduled basis and via manual triggers.
- The workflow includes steps for fast-forwarding the main branch, checking for updates on the cohere branch, and creating pull requests for any new commits.
- Enhanced error handling for merge conflicts and provided detailed instructions for conflict resolution in the generated pull requests.
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Fixed
Comment thread .github/workflows/sync-upstream.yaml Outdated
- Updated `sync-upstream.yaml` to deny all permissions at the workflow level, requiring explicit opt-in for jobs.
- Implemented concurrency control to prevent overlapping sync workflows.
- Enhanced security by ensuring the GITHUB_TOKEN is not persisted in the git configuration.
- Improved error handling and clarity in the fast-forwarding and merging processes, including better management of merge conflicts.
- Updated action versions for consistency and reliability.
- Added a temporary push trigger for the `feat/sync-upstream-workflow` branch to facilitate testing before merging.
- Maintained the existing scheduled sync functionality for the main branch.
- Updated `sync-upstream.yaml` to explicitly set the GITHUB_TOKEN environment variable, enhancing security by preventing token persistence in git configuration.
- Simplified the push command by removing the extraheader for authentication, streamlining the push process.
- Added comments for clarity regarding token handling and configuration steps.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5b75df5. Configure here.

# TEMPORARY: testing on feature branch — remove before merging to cohere.
push:
branches:
- feat/sync-upstream-workflow
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Temporary push trigger left in workflow file

Medium Severity

The push trigger on branch feat/sync-upstream-workflow is annotated with a comment explicitly stating it's "TEMPORARY: testing on feature branch — remove before merging to cohere." This debug trigger is still present and will cause the full sync workflow (including pushes to main and PR creation) to run on every push to that feature branch, and it will remain active after merging unless removed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5b75df5. Configure here.

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