Skip to content

fix(fetch-terraform-output): default environment_name to ref_name on push events#482

Merged
cpetit-sw merged 1 commit intomainfrom
fix/fetch-terraform-output-environment-default
Mar 26, 2026
Merged

fix(fetch-terraform-output): default environment_name to ref_name on push events#482
cpetit-sw merged 1 commit intomainfrom
fix/fetch-terraform-output-environment-default

Conversation

@cpetit-sw
Copy link
Copy Markdown
Member

What

Fix the default value of environment_name in the fetch-terraform-output workflow.

Why

github.base_ref is empty on push events (it's only set on pull requests), so the job was running without a GitHub environment — meaning AWS_ACCOUNT_ID and AWS_REGION vars were never loaded, causing the S3 state fetch to fail.

Changes

  • environment_name default: ${{ github.base_ref }}${{ github.base_ref || github.ref_name }}

Same fallback pattern already used by terraform_workspace in this same workflow.

Testing

Callers that explicitly pass environment_name are unaffected. Callers that rely on the default (push events) will now get the correct environment.

…push events

github.base_ref is empty on push events, causing the job to run without
a GitHub environment. Use the same fallback pattern as terraform_workspace:
base_ref || ref_name.
@cpetit-sw cpetit-sw requested a review from a team as a code owner March 26, 2026 10:56
@github-actions
Copy link
Copy Markdown
Contributor

🛡️ The security scan result : Repo and Config

@cpetit-sw cpetit-sw merged commit 2970504 into main Mar 26, 2026
3 checks passed
@cpetit-sw cpetit-sw deleted the fix/fetch-terraform-output-environment-default branch March 26, 2026 11:00
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.

2 participants