8000 Add additional info to the "Could not update the JSON file" error message by laurent22 · Pull Request #133 · contributor-assistant/github-action · GitHub
[go: up one dir, main page]

Skip to content

Conversation

laurent22
Copy link

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

} 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
0