fix: Added owner and repo args to getEnvironmentPublicKey

Signed-off-by: Mccaskey Skye <smccaskey@me.com>
This commit is contained in:
Mccaskey Skye
2024-07-10 12:57:23 -05:00
parent 3cd43cc452
commit ccfc9d12c1
3 changed files with 29 additions and 0 deletions
+16
View File
@@ -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,
});