Skip to content

Comments

Resolve PR merge conflicts by syncing fork's dev branch with upstream#1

Merged
bSi (brunusansi) merged 2 commits intodevfrom
claude/update-branch-to-latest-upstream
Feb 19, 2026
Merged

Resolve PR merge conflicts by syncing fork's dev branch with upstream#1
bSi (brunusansi) merged 2 commits intodevfrom
claude/update-branch-to-latest-upstream

Conversation

@Claude
Copy link

@Claude Claude AI commented Feb 19, 2026

PR #1 was in a dirty/conflicted state because the fork's dev branch was 2,202 commits behind anomalyco/models.dev, causing GitHub to report conflicts when attempting to merge.

Changes

  • Synced base branch: Reset fork's dev branch to match upstream/dev (829756f) and force-pushed to origin
  • Result: PR now cleanly shows only the 2 intended commits (sync workflow + Gemini 3.1 Pro model) instead of attempting to merge 2,200+ upstream commits

The PR is now in a clean mergeable state with correct file change stats (5 files, 155 additions).

Comment on lines +15 to +42
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Add upstream remote
run: |
git remote add upstream https://github.com/anomalyco/models.dev || true
git fetch upstream

- name: Sync dev branch
run: |
git checkout dev || git checkout -b dev
git reset --hard upstream/dev
git push --force origin dev

- name: Sync other branches if needed
run: |
# Add additional branch syncing here if needed
echo "Main dev branch synced successfully"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 2 days ago

In general, this problem is fixed by adding an explicit permissions block either at the workflow root (applies to all jobs) or at the individual job level, granting only the minimum scopes required. This ensures the GITHUB_TOKEN does not inherit broader default permissions from the repository or organization.

For this specific workflow, the sync job needs to push branches back to the repository (git push --force origin dev), which requires contents: write. It does not interact with issues, pull requests, or other resources, so we can keep those permissions at their default of none by omitting them. The simplest, least-privilege change is therefore to add a job-level permissions block under jobs: sync: with contents: write.

Concretely:

  • Edit .github/workflows/sync-upstream.yml.
  • Under jobs:, inside the sync job (right beneath runs-on: ubuntu-latest or above it), add:
    permissions:
      contents: write

No additional imports or external dependencies are required; this is purely a YAML configuration change in the workflow file.


Suggested changeset 1
.github/workflows/sync-upstream.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml
--- a/.github/workflows/sync-upstream.yml
+++ b/.github/workflows/sync-upstream.yml
@@ -13,6 +13,8 @@
 jobs:
   sync:
     runs-on: ubuntu-latest
+    permissions:
+      contents: write
     steps:
       - name: Checkout
         uses: actions/checkout@v4
EOF
@@ -13,6 +13,8 @@
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Copilot is powered by AI and may make mistakes. Always verify output.
@Claude Claude AI changed the title [WIP] Update branch to match latest upstream changes Sync fork with upstream and add automated sync workflow Feb 19, 2026
@Claude Claude AI requested a review from bSi (brunusansi) February 19, 2026 18:28
@Claude Claude AI changed the title Sync fork with upstream and add automated sync workflow Add Gemini 3.1 Pro model to GitHub Copilot provider Feb 19, 2026
@brunusansi bSi (brunusansi) marked this pull request as ready for review February 19, 2026 18:34
Claude AI and others added 2 commits February 19, 2026 18:37
Co-authored-by: brunusansi <173689862+brunusansi@users.noreply.github.com>
Co-authored-by: brunusansi <173689862+brunusansi@users.noreply.github.com>
@Claude Claude AI force-pushed the claude/update-branch-to-latest-upstream branch from 49dcebb to febb593 Compare February 19, 2026 18:38
@Claude Claude AI changed the title Add Gemini 3.1 Pro model to GitHub Copilot provider Sync fork with upstream and add Gemini 3.1 Pro to GitHub Copilot Feb 19, 2026
@Claude Claude AI changed the title Sync fork with upstream and add Gemini 3.1 Pro to GitHub Copilot Resolve PR merge conflicts by syncing fork's dev branch with upstream Feb 19, 2026
@brunusansi bSi (brunusansi) merged commit c8e7a57 into dev Feb 19, 2026
4 checks passed
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