Skip to content

actions/checkout@v4 does not fail despite Git reference collision error #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anas-baadshah opened this issue Mar 25, 2025 · 0 comments
Closed

Comments

@anas-baadshah
Copy link

What Happened

In our GitHub Actions workflow, we have a naming collision in remote references (release/12.51.0 vs. release/12.51.0/with-simple-card-changes), which typically causes Git to throw an error:

error: cannot lock ref 'refs/remotes/origin/release/12.51.0/with-simple-card-changes':
'refs/remotes/origin/release/12.51.0' exists; cannot create
'refs/remotes/origin/release/12.51.0/with-simple-card-changes'

Despite this Git error, the actions/checkout@v4 step did not fail. The workflow continued as if the checkout had succeeded, but subsequent steps encountered failures or inconsistent refs.

Expected Behavior

If a Git fetch or checkout operation runs into a reference lock error (or any non-zero exit from Git), we expect the checkout step to fail immediately (return a non-zero exit code). That way, the pipeline knows the repository was not correctly checked out.

Actual Behavior

The checkout step logged an error but did not fail. It exited with a success status, leading to a misleading workflow state.

Environment

Using actions/checkout@v4 in GitHub Actions:

- uses: actions/checkout@v4
  with:
    fetch-depth: 0
    token: ${{ secrets.FULL_ACCESS_TOKEN }}

The repository has (or had) conflicting branch references:
refs/remotes/origin/release/12.51.0 (a file)
refs/remotes/origin/release/12.51.0/with-simple-card-changes (would-be subfolder)

Note: we are not using continue-on-error on checkout step

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

No branches or pull requests

1 participant