-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve checks on github.ref fields #424
Conversation
Signed-off-by: Olla Gabriele <[email protected]>
Admin commands cheatsheet:
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, of course 🤦
Thanks for the contribution, would you mind adding a couple of tests in https://github.com/py-cov-action/python-coverage-comment-action/blob/main/tests/unit/test_settings.py#L126-L145 to ensure we don't get a regression ? Thanks !
I think I never thought it would happen because I've mainly tested with |
Signed-off-by: Olla Gabriele <[email protected]>
for more information, see https://pre-commit.ci
Exactly, I also unfairly blamed GtiHub at first, I thought there was some problem on push / pull_request triggers 😄
Sure, take a look if that's okay. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect 🤩
This PR arises from the problem of having
"pull"
substring inside your branch name.In particular, having a branch name like
ISSUE-XXX/task/enable-pull-lorem-ipsum
causes a crash in the action since the if insideGITHUB_PR_NUMBER
property wrongly assumes thatgithub.ref
refers to a PR, and tries to cast to integer the PR number.Goal of this PR is to make the check a bit stronger, for both
GITHUB_PR_NUMBER
andGITHUB_BRANCH_NAME
(since it's easier to incur in same problem with a tags that contains"heads"
substring inside it) checkinggithub.ref
head rather than randomly checking that a word is inside it.