Skip to content

Allow user to specify artifact name #44

Description

@TheBatman09

Use Case

Hello guys, I've started using this action and I came across the following issue: I have some dynamically retrieved data that I write with a step name and a matrix name. Then I retrieve some data again and try to write it with a different step name but same matrix name. And here when the data is the same for first and second time I get an error saying the artifact already exists. By looking at the code it looks like that's because the artifact name used is a hash of the content and in my case the content is the same in both cases.

Expected Behavior

I expect to be able to write the same data twice with a different step name.

Describe Ideal Solution

I think the ideal solution would be to add a parameter to the action to allow the user to chose the key used to store the artifact and/or also include the step name in the hash to allow storing twice the same data if it has a different step name.

Bonus

It seems like a fairly easy fix, i'd be happy to contribute if needed

Activity

  1. changed the title [-]Allow customer to specify artifact name[/-] [+]Allow user to specify artifact name[/+] on Mar 7, 2024
  2. TheBatman09 commented on Mar 20, 2024

    @TheBatman09
    Author

    Hey Igor Rodionov (@goruha) If you'd like I could propose a pull request for this 😉

  3. goruha commented on Mar 20, 2024

    @goruha
    Member

    TheBatman09, thanks for the feature request.
    Your PR is more than welcome.

  4. TheBatman09 commented on Mar 20, 2024

    @TheBatman09
    Author

    Voila !

  5. wildheartt commented on Jan 31, 2025

    @wildheartt

    Hi TheBatman09,

    Thank you for bringing this up! Your use case makes sense, and I can see how the current hashing mechanism could cause conflicts when trying to store the same data twice with different step names.

    I could say about some solutions in my mind:

    1. Allow users to specify a custom artifact name – This would give more control over naming and avoid hash-based conflicts.
    2. Include the step name in the hash calculation – This would differentiate artifacts even if their contents are identical.
    3. Provide an option to append a unique identifier (e.g., timestamp or UUID) – This would ensure uniqueness without requiring significant changes.
  6. TheBatman09 commented on Feb 3, 2025

    @TheBatman09
    Author

    Hey thanks for your answer, actually I forked to be able to use it back in the days and I did made a pr with solution 1 : https://github.com/cloudposse/github-action-matrix-outputs-write/pull/45/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions