Skip to content

Commit 970ee93

Browse files
committed
Introduce support for looking up GH app installation ID
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
1 parent 008e0db commit 970ee93

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

docs/spec/v1/gitrepositories.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ metadata:
371371
type: Opaque
372372
stringData:
373373
githubAppID: "<app-id>"
374+
githubAppInstallationOwner: "<github-org-or-user>"
374375
githubAppInstallationID: "<app-installation-id>"
375376
githubAppPrivateKey: |
376377
-----BEGIN RSA PRIVATE KEY-----
@@ -383,14 +384,19 @@ stringData:
383384
-----END CERTIFICATE-----
384385
```
385386

387+
Exactly one of `githubAppInstallationOwner` or `githubAppInstallationID` must be provided.
388+
If neither or both are provided, the reconciliation will fail with a misconfiguration error.
389+
When `githubAppInstallationOwner` is provided, the controller will look for the installation
390+
ID corresponding to the owner using the GitHub API.
391+
386392
Alternatively, the Flux CLI can be used to automatically create the secret with
387393
the github app authentication information.
388394

389395
```sh
390396
flux create secret githubapp ghapp-secret \
391397
--app-id=1 \
392-
--app-installation-id=3 \
393-
--app-private-key=~/private-key.pem
398+
--app-installation-owner=my-org \
399+
--app-private-key=~/private-key.pem
394400
```
395401

396402
### Service Account reference

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/fluxcd/pkg/artifact v0.5.0
2828
github.com/fluxcd/pkg/auth v0.33.0
2929
github.com/fluxcd/pkg/cache v0.12.0
30-
github.com/fluxcd/pkg/git v0.39.0
30+
github.com/fluxcd/pkg/git v0.39.1-0.20260118212638-6e3e8ddfe8fe
3131
github.com/fluxcd/pkg/gittestserver v0.23.0
3232
github.com/fluxcd/pkg/helmtestserver v0.34.0
3333
github.com/fluxcd/pkg/http/transport v0.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ github.com/fluxcd/pkg/auth v0.33.0 h1:3ccwqpBr8uWEQgl15b7S0PwJ9EgtcKObg4J1jnaof2
378378
github.com/fluxcd/pkg/auth v0.33.0/go.mod h1:ZAFC8pNZxhe+7RV2cQO1K9X62HM8BbRBnCE118oY/0A=
379379
github.com/fluxcd/pkg/cache v0.12.0 h1:mabABT3jIfuo84VbIW+qvfqMZ7PbM5tXQgQvA2uo2rc=
380380
github.com/fluxcd/pkg/cache v0.12.0/go.mod h1:HL/9cgBmwCdKIr3JH57rxrGdb7rOgX5Z1eJlHsaV1vE=
381-
github.com/fluxcd/pkg/git v0.39.0 h1:QydLWcsOso1BkO/ctE6ELlCFkhnGwpF2dUVa+R4aLp0=
382-
github.com/fluxcd/pkg/git v0.39.0/go.mod h1:MPhYH/ir7jr7cgQd75kWPHCGuJBu+sg7jzi0JPTSkKA=
381+
github.com/fluxcd/pkg/git v0.39.1-0.20260118212638-6e3e8ddfe8fe h1:skJigwja6WaD06uUVJ6YtohyWD2hu9D65Sz3GfOSMP4=
382+
github.com/fluxcd/pkg/git v0.39.1-0.20260118212638-6e3e8ddfe8fe/go.mod h1:MPhYH/ir7jr7cgQd75kWPHCGuJBu+sg7jzi0JPTSkKA=
383383
github.com/fluxcd/pkg/gittestserver v0.23.0 h1:o4tb4ic2GHf2xWHTf/07w/wVLFSvbybQ9bdhtWgDnS8=
384384
github.com/fluxcd/pkg/gittestserver v0.23.0/go.mod h1:b+rbFRu8HTtTFJ7mr437nHIO12pEodYqvQ3QUDHgFIQ=
385385
github.com/fluxcd/pkg/helmtestserver v0.34.0 h1:a6toTMPO6WfdohrkYCrs6vwOJK4VXpODLKc5311GawY=

0 commit comments

Comments
 (0)