Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mrhlpr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
mrhlpr
Commits
3b23338f
Unverified
Commit
3b23338f
authored
8 months ago
by
Newbyte
Browse files
Options
Downloads
Patches
Plain Diff
mrhlpr.mr: Improve error message when authentication fails (MR 47)
parent
135912ab
No related branches found
No related tags found
1 merge request
!47
mrhlpr.mr: Improve error message when authentication fails
Pipeline
#185183
passed
8 months ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrhlpr/mr.py
+9
-1
9 additions, 1 deletion
mrhlpr/mr.py
with
9 additions
and
1 deletion
mrhlpr/mr.py
+
9
−
1
View file @
3b23338f
...
...
@@ -469,7 +469,15 @@ def finish(
git
.
push_head
(
remote_local
,
status
.
source_branch
)
gl
=
gitlab_api
.
Gitlab
(
url
=
"
https://gitlab.com
"
,
private_token
=
gitlab_token
)
gl
.
auth
()
try
:
gl
.
auth
()
except
gitlab_api
.
exceptions
.
GitlabAuthenticationError
as
authentication_exception
:
logging
.
error
(
"
Authenticating with the token from GITLAB_TOKEN in the environment produced the following error: %s
\n\n
See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
"
,
authentication_exception
,
)
exit
(
1
)
project
=
gl
.
projects
.
get
(
origin
.
project_id
)
mr
=
project
.
mergerequests
.
get
(
mr_id
)
if
skip_approve
or
(
gl
.
user
and
mr
.
author
and
gl
.
user
.
id
==
mr
.
author
.
get
(
"
id
"
)):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment