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

Cant create refs/heads/feature/branch #2289

Open
3 of 7 tasks
samdnz opened this issue Aug 31, 2022 · 6 comments
Open
3 of 7 tasks

Cant create refs/heads/feature/branch #2289

samdnz opened this issue Aug 31, 2022 · 6 comments
Labels
Type: Bug Something isn't working as documented

Comments

@samdnz
Copy link

samdnz commented Aug 31, 2022

Please avoid duplicates

Reproducible test case

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgcwKYwPIGMYQNbDwC+cAZlBCHAEQACAhjsBAHYDOA9MoQBYCuAI2oAoUnxZNWcYGwDKMKMBbIAFAHce9GAC44bBUuQBKREWHnhWVvsRwAJlvpwSAXjj019QnAg58hADooVABHPlR9FWoAcQBRABU4DmojCyt2eAcYJzcPL3g0TD8CGCiUoIiYAO4qrGCtVAAlVFIVBGE4Tq7O4NJdal7OHlR6O05SEZg+YI4QAE8AWgmtadRqABoO7q62TX6AN3oAG2A7PU0Rba7gyH76FjmNrauINRZUKH6cAA8KyADXu8oJdtkQjABucwcDhwVDfMCoHDuOC9OC4OACVBwOqTVB2CzQ9w4PjHOCxKAUT5wZoTYISLF8MBZLGkLxHPFwI4QZBoM5qXhwFgQOAgaBYpSkCDCIA

Please select the environment(s) that are relevant to your bug report

  • TypeScript
  • Enterprise
  • Browsers
  • Node
  • Deno

Version

"@actions/github": "^5.0.3"

What happened?

When using the octokit via the actions package to create branches only names with 2 slashes are accepted.

refs/heads/feature will work

but refs/heads/feature/my-feature will not

Would you be interested in contributing a fix?

  • yes
@samdnz samdnz added the Type: Bug Something isn't working as documented label Aug 31, 2022
@oscard0m
Copy link
Member

Hi @samdnz,

Thanks for taking the time and effort on reporting the issue. Is very valuable that you share a TypeScript Playground.

I have some questions for you to try to get closer to the root cause of the issue:

  • Would it be possible to get the output error you are getting?

I'm guessing you are getting some kind of error when trying to run your command.

Thanks

@samdnz
Copy link
Author

samdnz commented Sep 1, 2022

creating refs/heads/acceptance/deploy-action-yaml from e0ff8a72cb53368408223a0426d6356aa327cc4c, pipeline-actions samdnz
Error: Reference update failed

with ref "refs/heads/acceptance-deploy-action-yaml" this would work

@timrogers
Copy link
Contributor

@samdnz I've just tried this locally using the same code as you and I am able to create a branch with a name with a slash in it (e.g. timrogers/foo).

Could you check your package-lock.json and share the versions of all of the Octokit packages you're using?

Could you also share a working code sample for a branch you are able to create?

@samdnz
Copy link
Author

samdnz commented Sep 2, 2022

https://github.com/samdnz/test-branch-create/runs/8157402605?check_suite_focus=true

everything is in this repo. the octokit dependency is transitive from the actions package

@timrogers
Copy link
Contributor

This is rather strange! Would you be able to try using Octokit directly instead? I'm wondering if there is a fix in more recent Octokit versions.

@samdnz
Copy link
Author

samdnz commented Sep 2, 2022

Yes this is rather strange. I have spent the better part of the week convincing myself that this was actually the cause of my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

3 participants