Skip to content

Comments

refactor(terraform): generate unique artifact name by default#889

Draft
hknutsen wants to merge 4 commits intomainfrom
refactor/terraform/generate-unique-artifact-name-by-default
Draft

refactor(terraform): generate unique artifact name by default#889
hknutsen wants to merge 4 commits intomainfrom
refactor/terraform/generate-unique-artifact-name-by-default

Conversation

@hknutsen
Copy link
Member

@hknutsen hknutsen commented Nov 14, 2025

There could be multiple jobs in a workflow deploying to the same environment, so using the environment name as a unique identifier could fail in some scenarios.

Generate a unique artifact name based on working directory and backend config instead - this is the combination that we already use to identify and queue jobs that target the same state file in the same concurrency group.

There could be multiple jobs in a workflow deploying to the same environment, so using the environment name as a unique identifier could fail in some scenarios.

Generate a unique artifact name based on job and run ID instead - there can only be one job of a given ID within a workflow run of a given ID, i.e. the combination of the two will be unique.
@hknutsen hknutsen marked this pull request as ready for review November 14, 2025 10:31
@hknutsen hknutsen requested a review from a team as a code owner November 14, 2025 10:31
@hknutsen
Copy link
Member Author

github.job might need to be set at step-level rather than workflow- or job-level. Will test then mark as ready for review again.

@hknutsen hknutsen marked this pull request as draft November 14, 2025 11:56
@hknutsen
Copy link
Member Author

[...] The artifact would get the name terraform-deploy-dev-12842626712, which is unique within that workflow run.

Currently artifact name is terraform-terraform-plan-12842626712, which is not what I want 🫠

Copy link
Member Author

@hknutsen hknutsen left a comment

Choose a reason for hiding this comment

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

Needs to be tested.

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.

1 participant