fix: Added owner and repo args to getEnvironmentPublicKey
Signed-off-by: Mccaskey Skye <smccaskey@me.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend-module-github': patch
|
||||
---
|
||||
|
||||
Fixed bug resulting from missing required owner and repo arguments in `octokit getEnvironmentPublicKey in action `github:environment:create`.
|
||||
|
||||
Adding environment secrets now works as expected.
|
||||
|
||||
```diff
|
||||
const publicKeyResponse = await client.rest.actions.getEnvironmentPublicKey({
|
||||
repository_id: repository.data.id,
|
||||
+ owner,
|
||||
+ repo,
|
||||
environment_name: name
|
||||
});
|
||||
```
|
||||
@@ -304,5 +304,16 @@ describe('github:environment:create', () => {
|
||||
key_id: 'keyid',
|
||||
encrypted_value: expect.any(String),
|
||||
});
|
||||
expect(
|
||||
mockOctokit.rest.actions.getEnvironmentPublicKey,
|
||||
).toHaveBeenCalledTimes(1);
|
||||
expect(
|
||||
mockOctokit.rest.actions.getEnvironmentPublicKey,
|
||||
).toHaveBeenCalledWith({
|
||||
repository_id: 'repoid',
|
||||
owner: 'owner',
|
||||
repo: 'repository',
|
||||
environment_name: 'envname',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -199,6 +199,8 @@ export function createGithubEnvironmentAction(options: {
|
||||
const publicKeyResponse =
|
||||
await client.rest.actions.getEnvironmentPublicKey({
|
||||
repository_id: repository.data.id,
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
environment_name: name,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user