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

Make error of token with less privileges more human readable #106

Open
glensc opened this issue Jan 26, 2021 · 3 comments
Open

Make error of token with less privileges more human readable #106

glensc opened this issue Jan 26, 2021 · 3 comments

Comments

@glensc
Copy link
Contributor

glensc commented Jan 26, 2021

Feature Request

Q A
New Feature yes
RFC yes/no
BC Break yes/no

Summary

The job at https://github.com/perftools/xhgui/runs/1768245086?check_suite_focus=true failed with Expected a value less than or equal to 299. Got: 403

Run laminas/automatic-releases@v1
/usr/bin/docker run --name b701c1ddc6e94b279ef6bde6662762df_a08c92 --label 442333 --workdir /github/workspace --rm -e GITHUB_TOKEN -e SIGNING_SECRET_KEY -e GIT_AUTHOR_NAME -e GIT_AUTHOR_EMAIL -e INPUT_COMMAND-NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/xhgui/xhgui":"/github/workspace" 442333:b701c1ddc6e94b279ef6bde6662762df  "laminas:automatic-releases:switch-default-branch-to-next-minor"
[2021-01-26T09:49:52.356516+00:00] automatic-releases.INFO: BumpAndCommitChangelogVersion: No CHANGELOG.md file detected [] []

In Assert.php line 2042:
                                                        
  Expected a value less than or equal to 299. Got: 403  
                                                        

laminas:automatic-releases:switch-default-branch-to-next-minor

It's better to say "Failed to create Milestone, the given token does not have enough privileges".

The error happened because the job was set up to run with GITHUB_TOKEN, but that has not enough privileges:

@glensc
Copy link
Contributor Author

glensc commented Feb 12, 2021

Here's another error with technical error, but no details what failed:

/usr/bin/docker run --name fb1f0f6c5fa4de78036da9a3ce64109_371a27 --label 442333 --workdir /github/workspace --rm -e GITHUB_TOKEN -e SIGNING_SECRET_KEY -e GIT_AUTHOR_NAME -e GIT_AUTHOR_EMAIL -e INPUT_COMMAND-NAME -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/xhgui/xhgui":"/github/workspace" 442333:3fb1f0f6c5fa4de78036da9a3ce64109  "laminas:automatic-releases:create-merge-up-pull-request"

In Assert.php line 2042:
                                                        
  Expected a value less than or equal to 299. Got: 422  
                                                        

laminas:automatic-releases:create-merge-up-pull-request

Related discussion:

@Ocramius
Copy link
Member

Possibly related: #76

@glensc
Copy link
Contributor Author

glensc commented Feb 12, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants