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

Can this work with Branch Protection? #256

Closed
kroese opened this issue Apr 27, 2023 · 6 comments
Closed

Can this work with Branch Protection? #256

kroese opened this issue Apr 27, 2023 · 6 comments

Comments

@kroese
Copy link

kroese commented Apr 27, 2023

I have my master branch protected so that it only accepts pull request and not normal pushes.

The other tag actions I tried could not work with this, so I am wondering if this one can? And if not, is there some workaround possible? For example by adding the tag push to the current pull request for example?

@kroese
Copy link
Author

kroese commented Apr 27, 2023

Okay, I just tried it, and got the familar cryptic message:

fatal: cannot lock ref refs/tags/***.***': Unable to create
/github/workspace/.git/refs/tags/***.***.lock: Filename too long

This has nothing to do with any filename being too long, because if I disable Branch Protection it works.

So is there a way to make this work?

@sbe-arg
Copy link
Collaborator

sbe-arg commented May 4, 2023

Can you share your workflow config and runner logs?

@kroese
Copy link
Author

kroese commented May 4, 2023

@sbe-arg It's just with the default workflow config from the readme, and the runner log doesnt contain anything more than the above error.

Branch protection disables pushing code directly to the branch, so in that way it makes sense that pushing the tag will fail too.

But on the other hand: I am able to create tags and releases on a protected branch just fine by using the Github REST API. So it seems the protection only applies to tags created via git push and not to tags created via a REST call.

So it would be nice if this action would fallback to using the API method when it detects the current method does not work.

@sbe-arg
Copy link
Collaborator

sbe-arg commented May 5, 2023

Have a look we don't do a git push https://github.com/anothrNick/github-tag-action/blob/1.62.0/entrypoint.sh#L236-L258

Share the logs please.

I personally use this in many many repos with extreme branch protections and the tags work like charm.

@sbe-arg
Copy link
Collaborator

sbe-arg commented May 5, 2023

More relevant information #210

@kroese
Copy link
Author

kroese commented May 5, 2023

@sbe-arg Okay, I discovered the source for my issue. And you were absolutely right that it has nothing to do with Branch Protection. I was a bit mislead because it worked fine in another repo where I did not have Branch Protection, but it turned out it was a problem with the contents of the variable I used for CUSTOM_TAG (which also was different between the two repos). My mistake, sorry.

@kroese kroese closed this as completed May 5, 2023
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

2 participants