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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/setupClaCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

core.setFailed(`Could not update the JSON file: ${err.message}${extraInfo}`)
}
}

Expand Down