google-github-actions / get-gke-credentials

A GitHub Action that configure authentication to a GKE cluster.
https://cloud.google.com/gke
Apache License 2.0
100 stars 41 forks source link

Add input for location or better naming of the generated file #268

Closed raphzandrade closed 1 year ago

raphzandrade commented 1 year ago

TL;DR

We utilize the action within a workflow that also commits and opens pull requests. Due to the fact that the generated file's name consists solely of a random hash, it is not possible to simply add it to our git ignore. Adding something similar to google-github-actions/auth@v1 would be a more effective solution.

image

Detailed design

No response

Additional information

No response

sethvargo commented 1 year ago

Hi @raphzandrade - do you mean for the KUBECONFIG file?

raphzandrade commented 1 year ago

Hi, @sethvargo! Yes, the one created here:

const kubeConfigPath = await writeSecureFile(randomFilepath(workspace), kubeConfig);

I believe incorporating additional information here would be beneficial. Don't you think?

EDIT: We are currently removing the file based on the path set by the action, but this method appears to be susceptible to future errors. It would be much more preferable to have a way to simply ignore the file.

sethvargo commented 1 year ago

I think it would be best to do what you're doing (or echo that value into a gitignore). We won't break the output without a major version bump.

Changing the path name could break people who might be depending on the location predictability.

raphzandrade commented 1 year ago

@sethvargo Is it possible to include this in a future version? I understand that it may disrupt the workflow for those who rely on location predictability, but I fail to see how adding something to the name (e.g kubeconfig-randomhash), would have that effect. Most of the logic likely relies on the path that is returned or set to the environment.