Skip to content

Commit

Permalink
Add info on GITHUB_TOKEN permissions when calls to GitHub API fail
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-op committed Mar 3, 2024
1 parent 0089ac0 commit b11ae73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/lib/github.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ class Analysis {
e.hasMessageContaining('Resource not accessible by integration')) {
gaction.log.warning(e.message!);
gaction.log.warning(
' It seems that this action doesn\'t have the required permissions to call the GitHub API with the token you gave.'
' This can occur if this repository is a fork, as in that case GitHub reduces the GITHUB_TOKEN\'s permissions for security reasons.'
'It seems that this action doesn\'t have the required permissions to call the GitHub API with the token you gave.'
' Consequently, no report will be made on GitHub.'
'\n\n* Verify that GITHUB_TOKEN is granted read and write permissions in your repository settings:'
' https://github.com/${slug.fullName}/settings/actions.'
'\n\n* If this repository is a fork, GitHub has reduced GITHUB_TOKEN\'s permissions for security reasons.'
' Check this issue for more information:'
' https://github.com/axel-op/dart-package-analyzer/issues/2');
return Analysis._(client, null, slug);
Expand Down

0 comments on commit b11ae73

Please sign in to comment.