From c6cc797f8084b81381518281200c0ad0f375158b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 03:33:44 +0000 Subject: [PATCH] fix(ci): robust upstream fetch in agent pr review Updates the `agent-pr-review.yml` workflow to prevent failures when calculating diffs against the upstream repository. Changes: - Reverts `git fetch` to a full fetch to ensure all remote-tracking branches (like `refs/remotes/upstream/unstable`) are correctly updated in the local environment. - Adds a mandatory `Verify upstream branch and diff` step that checks for the existence of the target base branch (`upstream/${{ github.base_ref }}`) using `git rev-parse`. - Performs a dry-run `git diff` to confirm connectivity before running the main review script. - Ensures the job fails explicitly with a clear error message if the upstream branch is missing, rather than crashing later with an obscure exit code 1. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- .github/workflows/agent-pr-review.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/agent-pr-review.yml b/.github/workflows/agent-pr-review.yml index a014d622..ec3ae661 100644 --- a/.github/workflows/agent-pr-review.yml +++ b/.github/workflows/agent-pr-review.yml @@ -34,6 +34,15 @@ jobs: git remote add upstream https://github.com/PR0M3TH3AN/bitvid.git || true git fetch upstream + - name: Verify upstream branch and diff + run: | + if ! git rev-parse --verify upstream/${{ github.base_ref }} >/dev/null 2>&1; then + echo "::error::Branch upstream/${{ github.base_ref }} not found." + exit 1 + fi + # Verify we can diff against it + git diff --name-only upstream/${{ github.base_ref }}...HEAD + - name: Run Agent Review env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}