-
Couldn't load subscription status.
- Fork 61
Description
docker-tools/src/Microsoft.DotNet.ImageBuilder/src/OctokitClientFactory.cs
Lines 77 to 78 in c976138
| Installation? appInstallation = appInfo.Installations.FirstOrDefault() | |
| ?? throw new InvalidOperationException( |
In our Go tools, we always just take the installation ID as another auth-related parameter. We aren't using any installation listing API, so at the time we thought that if we wanted to find it automatically, we'd have to have our own mapping of org/repo -> installation ID, so we simply provide the installation ID to our tools.
I believe I encountered an error once when I used the wrong installation ID, because that installation didn't have permission for the target repository. (This might be something we're hitting with our attempt to use this feature, but I'm not set up to easily debug it.)
A few possible suggestions:
- Use
Singlerather thanFirst(or something like that) to fail if there are too many installations rather than picking one arbitrarily. (But this might not support us--I'm not sure if we (still) have multiple installations.) - Cross-reference the input target of the current operation to determine which installation to use.
- (Optionally?) Take the installation ID as an arg.
- Log the encountered installations to aid debugging when working with "real" secrets through the gloves of AzDO pipelines.
/cc @gdams
Metadata
Metadata
Assignees
Labels
Type
Projects
Status