Skip to content

Commit

Permalink
use correct installation id for queue item (#1684)
Browse files Browse the repository at this point in the history
* use correct installation id for queue item

* deploy

* deplou
  • Loading branch information
motatoes authored Aug 29, 2024
1 parent a91951e commit d0ff3f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/next_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- develop # change to main if needed
- feat/github-orgid-endpoint
- fix/use-correct-installation-id-for-queue-item
jobs:
deploy:
name: Deploy app
Expand Down
9 changes: 8 additions & 1 deletion next/controllers/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@ func processSingleQueueItem(gh next_utils.GithubClientProvider, queueItem model.
log.Printf("could not get repo: %v", err)
return fmt.Errorf("could not get repo: %v", err)
}

installation, err := dbmodels.DB.GetGithubAppInstallationByOrgAndRepo(repo.OrganizationID, repo.RepoFullName, dbmodels.GithubAppInstallActive)
if err != nil {
log.Printf("could not get github installation: %v", err)
return fmt.Errorf("could not get github installation: %v", err)
}

repoFullName := repo.RepoFullName
repoOwner := repo.RepoOrganisation
repoName := repo.RepoName
service, _, err := next_utils.GetGithubService(gh, dr.GithubInstallationID, repoFullName, repoOwner, repoName)
service, _, err := next_utils.GetGithubService(gh, installation.GithubInstallationID, repoFullName, repoOwner, repoName)
if err != nil {
log.Printf("failed to get github service for DiggerRun ID: %v: %v", dr.ID, err)
return fmt.Errorf("failed to get github service for DiggerRun ID: %v: %v", dr.ID, err)
Expand Down

0 comments on commit d0ff3f4

Please sign in to comment.