Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Workspace name #21

Open
adamlc opened this issue Feb 13, 2024 · 4 comments
Open

Specify Workspace name #21

adamlc opened this issue Feb 13, 2024 · 4 comments

Comments

@adamlc
Copy link

adamlc commented Feb 13, 2024

I've just started to experiment and it looks like this action uses the folder name as the name of the workspace.

Would it be possible to specify the workspace so it doesn't rely on the folder name? Unless I'm missing something :)

I've also noticed that despite what branch is specified, if a VCS workspace is used, then the remote plan always runs against the main branch and not the branch of the pull request etc

@alfespa17
Copy link
Member

Hello @adamlc

It is using the workspace folder as the workspace name as you can see in this part of the code:

let workspaceId = await terrakubeClient.getWorkspaceId(organizationId, workspaceFolder)

core.debug(`GET ${this.gitHubActionInput.terrakubeEndpoint}/api/v1/organization/${organizationId}/workspace?filter[workspace]=name==${workspaceName}"`)

It has been a long time since I update this action (1.5 years ago), maybe it will need a few adjustments.

@alfespa17
Copy link
Member

There is one example that show how to use the action here

@adamlc
Copy link
Author

adamlc commented Feb 13, 2024

@alfespa17 yes thanks, I can confirm that using the folder name did indeed work. Ideally it would be great if we could just specify a workspace ID, otherwise we'll have to refactor quite a lot of our TF config :)

@alfespa17
Copy link
Member

@alfespa17 yes thanks, I can confirm that using the folder name did indeed work. Ideally it would be great if we could just specify a workspace ID, otherwise we'll have to refactor quite a lot of our TF config :)

I dont think this will require a lot of changes basically instead of searching the workspaceId here using the workspaceFolder you could read the workspaceId from the "terrakube.json" that for now only has the terraform version, reading data from that configuration file is quite simple like this

I dont have a lot of bandwith for the following weeks but if you would like to help with this feature all pull request are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants