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

Add additional info to the "Could not update the JSON file" error message #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laurent22
Copy link

The error message is confusing when the branch is protected, so this pull request adds additional information.

@@ -52,7 +52,9 @@ export async function setupClaCheck() {
)
}
} catch (err) {
core.setFailed(`Could not update the JSON file: ${err.message}`)
let extraInfo = '';
if (err.message.includes('Changes must be made through a pull request')) extraInfo = ' (The branch appears to be protected - please disable the protection)';
Copy link
Member

@ibakshay ibakshay Feb 16, 2023

Choose a reason for hiding this comment

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

@laurent22 Could you please check why the content inside extraInfo variable is not printed in the error logs?
I tested your contribution from my test repository after enabling branch protection.
Screenshot 2023-02-16 at 14 39 25

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

Successfully merging this pull request may close these issues.

2 participants