I have an environment that contains an application that’s connected to GitHub. I’d like to use the CLI to update the branch it’s pointed at, but I get errors when doing that. Here’s what I’m doing:
QOVERY_CLI_ACCESS_TOKEN=XXX qovery application update --organization="Grayce" --project="grayce" --environment="[PR] - build: working on updating the build process for qovery" --application="Frontend" --auto-deploy=true --branch="demolio"
When I run this I get:
Error: 400 Bad Request
If I run it with verbose mode on, it ends up with an error like this:
2024/06/18 11:26:54
HTTP/2.0 400 Bad Request
Connection: close
Content-Type: application/problem+json
Date: Tue, 18 Jun 2024 15:26:54 GMT
Strict-Transport-Security: max-age=15724800; includeSubDomains
{"type":"about:blank","title":"Bad Request","status":400,"detail":"You don't have any provider configured for GITHUB","instance":"/api/application/52d4d791-80ba-4d9d-8a6c-2dabe917b62d","message":"You don't have any provider configured for GITHUB"}
I do have a git repository configured in the UI, and GitHub connections are working just fine in general. Am I doing something wrong in how I’m calling the CLI?
I’ve confirmed that this works fine using the API directly. The problem seems to be that the CLI is not passing the git token ID. When I call the edit application endpoint in the API, I’m sending this as the git repository block of the JSON in the request:
I got the git token id from querying the API for the application. I’m trying to do this from a GitHub Actions workflow, so I guess I could figure out how to use the API directly there, but it’s going to be pretty yucky. I don’t see any available arguments for the CLI that would make it behave the way I need it to.
I’ll take a look at the CLI code and see about submitting a PR to fix this but it’d be great to get a little help on this.
All right, I created a PR for the CLI here. It’s a simple change. I suppose it could break something for situations different from mine, but all it’s doing is passing back the token id that it got from the query about the application, so it seems pretty safe to me…