laminas / automatic-releases

Automated release process for `laminas/` projects, usable as github action
Other
141 stars 23 forks source link

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

Open glensc opened 3 years ago

glensc commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Possibly related: #76

glensc commented 3 years ago

The problem I just reported half-hour ago:

got magically solved:

yes, logging would help!