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

feat: specify artifact name #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheBatman09
Copy link

what

An optional input artifact-name is added to allow the user to specify how to name the artifacts stored.
If the input is missing, the hash is used as before.

why

Due to the use of a hash of the content as an artifact name, if different steps (with a different step name) try to use the action to write the same content, the build will fail. The first step will succeed but the second one will fail because an artifact with the same name already exists.

references

Fixes #44

@@ -74,7 +78,7 @@ ${error}`;
const hex = hashSum.digest('hex');

const artifactClient = new DefaultArtifactClient();
const artifactName = hex;
const artifactName = isEmptyInput(artifact_name) ? hex : artifact_name + matrix_key;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitated here to rename the artifactName const to something else to differentiate them. However since I noticed inputs are in snake case, I thought maybe that's your convention to differentiate inputs form the rest and that's enough

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

Successfully merging this pull request may close these issues.

Allow user to specify artifact name
1 participant