fix: write baked manifest into the workspace - #289
Merged
Suneha Bose (bosesuneha) merged 1 commit intoAug 6, 2026
Merged
Conversation
k8s-deploy v7 rejects manifests that resolve outside GITHUB_WORKSPACE. Bake wrote to RUNNER_TEMP, which is a sibling of the workspace on hosted runners, so the bake -> deploy chain no longer worked and there was no way to override the location. Output now goes to $GITHUB_WORKSPACE/.k8s-bake/, falling back to RUNNER_TEMP with a warning when there is no workspace. A post-job step removes the manifest it generated, and the directory if that leaves it empty. Consumers reading the manifestsBundle output need no changes.
David Gamero (davidgamero)
approved these changes
Aug 6, 2026
David Gamero (davidgamero)
left a comment
Collaborator
There was a problem hiding this comment.
lgtm
This was referenced Aug 7, 2026
David Gamero (davidgamero)
pushed a commit
that referenced
this pull request
Aug 11, 2026
Every example pinned actions that are one to three majors behind, and two were actively misleading: - actions/checkout@master resolved to a branch frozen at 2020-07-13, so the end-to-end example shipped six-year-old checkout code. master is a real branch in that repo, not a redirect to main. - Azure/k8s-deploy@v4 paired with bake output no longer reflects reality. Since k8s-deploy v7 confines manifests to GITHUB_WORKSPACE and bake v4.1.1 writes there (#289), the example should show the combination that actually works. Bumped to current majors: azure/k8s-bake v3 -> v4 (4 examples) actions/checkout master -> v7 Azure/docker-login v1 -> v2 Azure/k8s-set-context v3 -> v5 Azure/k8s-create-secret v4 -> v6 Azure/k8s-deploy v4 -> v7 Verified every input used in the examples still exists at the new major, so the snippets remain runnable. k8s-set-context v5 defaults method to kubeconfig and cluster-type to generic, so the kubeconfig-only example is unchanged in behavior. Also repointed the action metadata link from blob/master to blob/main. The old URL only worked via redirect.
David Gamero (davidgamero)
pushed a commit
to Azure/k8s-deploy
that referenced
this pull request
Aug 11, 2026
The bake example paired azure/k8s-bake@v3 with Azure/k8s-deploy@v7, which cannot work. Since v7, assertPathWithinWorkspace rejects manifests that resolve outside GITHUB_WORKSPACE, and k8s-bake before v4.1.1 wrote the baked manifest to RUNNER_TEMP, a sibling of the workspace on hosted runners. Copying the documented example produced: manifest path /home/runner/work/_temp/baked-template-<ts>.yaml resolves to ..., which is outside the workspace /home/runner/work/repo/repo k8s-bake v4.1.1 writes into $GITHUB_WORKSPACE/.k8s-bake/ instead (Azure/k8s-bake#289), so the chain works again with no change on the k8s-deploy side. Bump the example to @v4 and state the minimum version, since nothing in this repo currently tells users the bake upgrade is the fix. Refs #553
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #286
Problem
k8s-deployv7 rejects manifests that resolve outsideGITHUB_WORKSPACE. Bake writes toRUNNER_TEMP, which is a sibling of the workspace on hosted runners, so the bake -> deploy chain fails and there is no way to override the location.Change
Output goes to
$GITHUB_WORKSPACE/.k8s-bake/, falling back toRUNNER_TEMPwith a warning when there is no workspace. A post-job step removes the manifest it generated, and the directory if that leaves it empty.Applies to all three render engines through the shared
getTemplatePathhook.Breaking: the output location changes. Workflows reading
${{ steps.bake.outputs.manifestsBundle }}need no changes.k8s-deployneeds no changes.Notes
Cleanup deletes only the filename the main step recorded, never a path from step state, and refuses symlinks. A pre-existing
.k8s-bakedirectory or unrelated files in it are left alone.Test plan
npm test, 119 testsnpm run build,tsc --noEmit,prettier --checkRUNNER_TEMPstays empty, post step leaves the checkout cleank8s-deployv7.k8s-bake/user-file.txtand.k8s-bake/baked-template-123.yamlsurvive cleanupVersion bump and changelog follow in a separate release PR.