Skip to content
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

PR branch names start with a randomised hash which means we're unable to target them with github actions #5778

Closed
1 task done
AnnekaSillitoe opened this issue Sep 22, 2022 · 5 comments
Labels
F: pull-requests Issues about Dependabot pull requests Stale T: bug 🐞 Something isn't working

Comments

@AnnekaSillitoe
Copy link

AnnekaSillitoe commented Sep 22, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

yarn

Package manager version

No response

Language version

No response

Manifest location and content before the Dependabot update

No response

dependabot.yml content

No response

Updated dependency

No response

What you expected to see, versus what you actually saw

We're running Chromatic to publish storybook on our new repo, but we want to skip this github action running on dependabot branches.

They suggest adding skip: dependabot/** to the chromatic.yml file for this purpose. We have done this on our other repo.
However, as branch names on here don't start the same as expected, we're unable to target them.

Is there a reason the branch names start with a random hash here?

Is there a way to ask Dependabot to name its branches in a set way for us to target?

We have another repo where all branches open like this:
Screenshot 2022-09-22 at 11 02 41

This new repo, the branches are structures like this:
Screenshot 2022-09-22 at 10 57 50
Screenshot 2022-09-22 at 10 57 39

Native package manager behavior

No response

Images of the diff or a link to the PR, issue, or logs

No response

Smallest manifest that reproduces the issue

No response

@AnnekaSillitoe AnnekaSillitoe added the T: bug 🐞 Something isn't working label Sep 22, 2022
@jeffwidman
Copy link
Member

This may be related to:

@jeffwidman jeffwidman added the F: pull-requests Issues about Dependabot pull requests label Sep 22, 2022
@jackbot
Copy link

jackbot commented Sep 23, 2022

@jeffwidman I thought this too, but the hash is being applied to the beginning of our branch names, not the end. From what I understand of the max_length configuration option, it'll truncate any branch names exceeding this length and chuck the hash at the end. But I might just be misunderstanding the code.

@deivid-rodriguez
Copy link
Contributor

Do you have a branch named "dependabot" in your repository? Having a branch named "dependabot" prevents Dependabot from using its default naming scheme. Because branch names map to files names in the system (for example, .git/refs/heads/dependabot), git will refuse to create a branch named "dependabot/foo" because a parent directory of .git/refs/heads/dependabot/foo already exists.

This is a known git limitation, so unlikely that we can fix it, but Dependabot deals with the situation by prepending a random prefix to the branch name to resolve the conflict. However, it does not explain why it does this, so it gets confusing when it happens.

We do plan to add a note about this in PRs where this is happening, so that the reason for this is more clear.

@jackbot
Copy link

jackbot commented Oct 4, 2022

@deivid-rodriguez you got it! We do have a dependabot branch. Thanks for the help and the thorough explanation, makes total sense.

Copy link
Contributor

github-actions bot commented Oct 4, 2024

👋 This issue has been marked as stale because it has been open for 2 years with no activity. You can comment on the issue to hold stalebot off for a while, or do nothing. If you do nothing, this issue will be closed eventually by the stalebot. Please see CONTRIBUTING.md for more policy details.

@github-actions github-actions bot added the Stale label Oct 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: pull-requests Issues about Dependabot pull requests Stale T: bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants