Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/update-copilot-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

if git rev-parse --verify "origin/$BRANCH" >/dev/null 2>&1; then
git fetch origin "$BRANCH"
Comment on lines 81 to +82

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

git rev-parse --verify "origin/$BRANCH" only checks for a local remote-tracking ref. On a fresh Actions checkout this ref typically won’t exist for non-default branches, so this condition can still be false even when the remote branch exists—meaning the new git fetch origin "$BRANCH" never runs and --force-with-lease can remain stale. Consider checking remote existence via git ls-remote --exit-code --heads origin "$BRANCH" (or attempting an explicit refspec fetch and branching on its exit code), then fetching +refs/heads/$BRANCH:refs/remotes/origin/$BRANCH to ensure the tracking ref is populated/updated.

Suggested change
if git rev-parse --verify "origin/$BRANCH" >/dev/null 2>&1; then
git fetch origin "$BRANCH"
if git ls-remote --exit-code --heads origin "$BRANCH" >/dev/null 2>&1; then
git fetch origin "+refs/heads/$BRANCH:refs/remotes/origin/$BRANCH"

Copilot uses AI. Check for mistakes.
git checkout "$BRANCH"
git reset --hard HEAD
git reset --hard "origin/$BRANCH"
Comment on lines 83 to +84

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

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

git reset --hard "origin/$BRANCH" will discard the dependency/codegen changes produced by the earlier workflow steps (since this runs after the update/format steps). If the intent is only to refresh remote-tracking info for --force-with-lease, avoid a hard reset here; alternatively stash changes before switching/resetting and re-apply them, or move the branch checkout/reset logic earlier (before modifications are made).

Copilot uses AI. Check for mistakes.
else
git checkout -b "$BRANCH"
fi
Expand Down
Loading