fix(scaffolder-backend-module-github): createEnvironmentVariable missing owner and repo

Signed-off-by: Diego Iglesias <diegohi@gmail.com>
This commit is contained in:
Diego Iglesias
2024-06-24 23:40:01 +02:00
parent 0d9f969d91
commit 4410fed9d9
4 changed files with 15 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Fixed issue with octokit call missing owner and repo when creating environment variables using github:environment:create action
@@ -221,6 +221,8 @@ describe('github:environment:create examples', () => {
mockOctokit.rest.actions.createEnvironmentVariable,
).toHaveBeenCalledWith({
repository_id: 'repoid',
owner: 'owner',
repo: 'repository',
environment_name: 'envname',
name: 'key1',
value: 'val1',
@@ -229,6 +231,8 @@ describe('github:environment:create examples', () => {
mockOctokit.rest.actions.createEnvironmentVariable,
).toHaveBeenCalledWith({
repository_id: 'repoid',
owner: 'owner',
repo: 'repository',
environment_name: 'envname',
name: 'key2',
value: 'val2',
@@ -240,6 +240,8 @@ describe('github:environment:create', () => {
mockOctokit.rest.actions.createEnvironmentVariable,
).toHaveBeenCalledWith({
repository_id: 'repoid',
owner: 'owner',
repo: 'repository',
environment_name: 'envname',
name: 'key1',
value: 'val1',
@@ -248,6 +250,8 @@ describe('github:environment:create', () => {
mockOctokit.rest.actions.createEnvironmentVariable,
).toHaveBeenCalledWith({
repository_id: 'repoid',
owner: 'owner',
repo: 'repository',
environment_name: 'envname',
name: 'key2',
value: 'val2',
@@ -187,6 +187,8 @@ export function createGithubEnvironmentAction(options: {
for (const [key, value] of Object.entries(environmentVariables ?? {})) {
await client.rest.actions.createEnvironmentVariable({
repository_id: repository.data.id,
owner: owner,
repo: repo,
environment_name: name,
name: key,
value,