Merge pull request #25577 from skyem/master

fix: Added owner and repo args to getEnvironmentPublicKey
This commit is contained in:
Patrik Oldsberg
2024-07-11 17:26:49 +02:00
committed by GitHub
3 changed files with 20 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Fixed bug resulting from missing required owner and repo arguments in `getEnvironmentPublicKey` in action `github:environment:create`.
Adding environment secrets now works as expected.
@@ -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,
});