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

bug: Branch Ruleset API call fails when a user/org doesn't have the ruleset feature #345

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

GrantBirki
Copy link
Member

@GrantBirki GrantBirki commented Dec 16, 2024

This pull request handles an edge case / bug where the Branch Ruleset API call fails when a user or organization does not have the ruleset feature. The error would look something like this:

Upgrade to GitHub Pro or make this repository public to enable this feature.

Since repository rulesets are not available on "free" accounts in "private" repos, this Action would fail. Since these checks are simply "warnings" to let users know if any misconfigurations are taking place, we should gracefully handle these errors and not fail the entire Action.

related: #342 (comment)

Example 📸

If you see a message like this:

Screenshot 2024-12-16 at 11 06 09 AM

... then you will likely not be able to utilize the branch ruleset checks that this Action performs.

@GrantBirki GrantBirki added the bug Something isn't working label Dec 16, 2024
@GrantBirki GrantBirki self-assigned this Dec 16, 2024
@Copilot Copilot bot review requested due to automatic review settings December 16, 2024 18:32

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/functions/branch-ruleset-checks.js:71

  • The help_text message is too long and may be truncated in some logging systems. Consider breaking it into multiple lines or shortening the message.
core.debug(ERROR.messages.upgrade_or_public.help_text)

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@GrantBirki GrantBirki mentioned this pull request Dec 16, 2024
@GrantBirki GrantBirki merged commit 1c7b2cc into main Dec 16, 2024
4 checks passed
@GrantBirki GrantBirki deleted the branch-ruleset-fixes branch December 16, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant