Skip to content

Fix GHES v3 encrypted plan file upload path#519

Merged
rdhar merged 2 commits intoOP5dev:mainfrom
EmNaveed:download-file-fix-for-ghe
Nov 22, 2025
Merged

Fix GHES v3 encrypted plan file upload path#519
rdhar merged 2 commits intoOP5dev:mainfrom
EmNaveed:download-file-fix-for-ghe

Conversation

@EmNaveed
Copy link
Copy Markdown
Contributor

Fixes a critical bug where encrypted Terraform plan files were not being properly uploaded in GitHub Enterprise Server (GHES) environments, causing plan file downloads to fail during the apply phase.

Problem
The GHES v3 upload step was missing the .encrypted suffix in the file path, creating a mismatch between what gets uploaded and what the download logic expects:

GitHub.com/GHE.com (v5): ✅ Correctly uploads tfplan.encrypted
GHES (v3): Only uploads tfplan (missing .encrypted suffix)
Download logic: Expects tfplan.encrypted when encryption is enabled
This caused the artifact lookup to fail with "Unable to locate plan file" errors in GHES environments when plan encryption was enabled.

✅ Solution
Updated the GHES v3 upload step to include the encrypted suffix using the same format string pattern as the v5 upload:

Before (GHES v3)

path: ${{ format('{0}{1}tfplan', ...) }}

After (GHES v3) - now matches v5 behavior

path: ${{ format('{0}{1}tfplan{2}', ..., inputs.plan-encrypt != '' && '.encrypted' || '') }}

@EmNaveed EmNaveed requested a review from rdhar as a code owner November 18, 2025 17:31
@rdhar
Copy link
Copy Markdown
Member

rdhar commented Nov 22, 2025

What a blatant oversight, thanks so much for spotting and fixing up GHE uploads for all users!

@rdhar rdhar merged commit 9774540 into OP5dev:main Nov 22, 2025
12 checks passed
@rdhar
Copy link
Copy Markdown
Member

rdhar commented Nov 22, 2025

Happy to see this shipped with v13.7.2 (v13), where your contribution has been credited!

Please consider ⭐ this project, if you or your team find it useful.

GitHub repository stargazers


@EmNaveed Thanks once again for spotting this discrepancy and raising a PR to fix it, very much appreciated!

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.

3 participants