Skip to content

fix: Fix the VSCode build GitHub Action #8

@alxayo

Description

@alxayo

The job is failing for two reasons shown in the logs, and you can fix it by disabling the dependency graph/snapshot part and removing the hard-coded main diff assumption.

  1. Disable the dependency graph (you said you don’t need it)
    Your logs show Dependabot is running a graph job:

command":"graph"
snapshots_unavailable_graph_error {message: "Unable to submit data to the Dependency Snapshot API"}
plus TLS/handshake warnings to github.com:443
Since you don’t need dependency graph submission, the practical fix is to stop running Dependabot in graph mode / stop snapshot submission in your workflow configuration (or remove the step/action that submits a dependency snapshot). This eliminates the entire failing “Dependency Snapshot API” call path.

If you tell me which workflow/step is invoking Dependabot (name of the workflow file + step), I can point to the exact lines to remove/adjust.

  1. Fix the real “exit code 128” failure: git diff against main
    The job ultimately fails here:

Error: Command failed with exit code 128: git diff ...
fatal: ambiguous argument 'main': unknown revision or path not in the working tree.
Even though your repo’s default branch is main (confirmed by repo metadata), this error means that the checked-out workspace in the job does not actually have a local main ref available at the moment the command runs (common with shallow checkouts, detached HEAD, or single-branch fetch).

Recommended fix (robust): fetch the base branch and/or use the default branch dynamically
Wherever your workflow/action runs git diff ... main ..., update it to:

ensure full history/refs are available, and
diff against the actual default branch from the workflow context.
A safe pattern:

YAML

  • uses: actions/checkout@v4
    with:
    fetch-depth: 0

  • name: Diff against default branch
    run: |
    BASE_REF="${{ github.event.repository.default_branch }}"
    git fetch origin "${BASE_REF}:${BASE_REF}"
    git diff "${BASE_REF}"...HEAD
    If this runs on pull requests and you want the PR base specifically:

YAML

  • uses: actions/checkout@v4
    with:
    fetch-depth: 0

  • name: Diff PR base -> HEAD
    if: ${{ github.event_name == 'pull_request' }}
    run: |
    git fetch origin "${{ github.base_ref }}:${{ github.base_ref }}"
    git diff "${{ github.base_ref }}"...HEAD
    Why this fixes it
    It guarantees the branch name you’re diffing against actually exists locally, instead of assuming main is present in a shallow/detached checkout.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions