rhd-gitops-example / services

Intra-Git repository promotions for GitOps.
Apache License 2.0
7 stars 8 forks source link

Fail the automerge task when a problem occurs e.g. bad credentials #111

Closed a-roberts closed 4 years ago

a-roberts commented 4 years ago

Tiny one, closes https://github.com/rhd-gitops-example/services/issues/110

Tested by using good/bad credentials. With the good credentials it continues to pass and with the bad ones, merge-pr gets to:

+ '[' pull_request = push ']'
+ '[' pull_request = pull_request ']'
+ git config --global --add hub.host github.ibm.com
+ git config --global user.name a-roberts
+ git config --global user.email myemail
+ cd git-source
+ export HUB_VERBOSE=true
+ HUB_VERBOSE=true
+ hub merge https://github.ibm.com/AROBERTS/gitops-example-dev/pull/2
$ git config --get-all hub.host
> GET https://github.ibm.com/api/v3/user
> Authorization: token [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 401
{"message":"Bad credentials","documentation_url":"https://developer.github.com/enterprise/2.19/v3"}
> GET https://github.ibm.com/api/v3/repos/AROBERTS/gitops-example-dev/pulls/2
> Authorization: token 
> Accept: application/vnd.github.v3+json;charset=utf-8
< HTTP 401
{"message":"Bad credentials","documentation_url":"https://developer.github.com/enterprise/2.19/v3"}
Error getting pull request: Unauthorized (HTTP 401)
Bad credentials
dibbles commented 4 years ago

Checking this...