mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
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 <[email protected]>
This commit is contained in:
1 parent
d9cd2ff745
commit
c6cc797f80
1 file changed
+9
@@ -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 }}
|
||||
|
||||
Reference in new issue
Block a user