fix(ci): move FORGEJO_TOKEN to step-env so the secret reaches nu #113
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forgejo-token-step-env-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
#112's
build-desktop-linux.ymlrun failed at DELETE:Same secret + same URL + same workflow shape as
yotun/.forgejo/workflows/build-desktop-linux.yml::Upload to generic package registry, which is the working reference. The structural difference is scope: yotun declaresFORGEJO_TOKENin the step-levelenv:block on the upload step; #110/#112 had it in the job-levelenv:block. Inside theshell: nu {0}step$env.FORGEJO_TOKENevidently resolved to an empty string from job scope, producing the literal headerAuthorization: token(token, space, empty) which Forgejo's Packages endpoint correctly rejects with 401.PACKAGE_OWNERandPACKAGE_NAMEfrom the same job-env block survive fine (the URL in the failing log hasa8n-tools-privateandlets-chatinterpolated correctly), so this is specific to how Forgejo Actions surfaces secrets vs vars at job scope rather than to all job-env values.Changes (three files, mirroring yotun)
.forgejo/workflows/build-desktop-linux.yml.forgejo/workflows/build-desktop-windows.yml.forgejo/workflows/publish-release.ymlEach file: remove
FORGEJO_TOKEN: ${{ secrets.A8N_TOOLS_PRIVATE_PACKAGE_PAT }}from the job-levelenv:block, add the same line to the step-levelenv:block on theUpload binary[ies] ... to Generic Packagesstep.PACKAGE_OWNERandPACKAGE_NAMEstay at job-env because they work there. Job-env comments call out the gotcha so the next reader does not move FORGEJO_TOKEN back up.The nu-builtin call shape itself, the URL builder, and the
[204 404]DELETE-status guard from #112 are unchanged. This commit is strictly the secret-scope move.Test plan
main:build-desktop-linux.ymlandbuild-desktop-windows.ymlcomplete and produce${ORG}/generic/lets-chat/latest/lets-chat-desktop-{linux,windows}-x86_64[.exe]in the Generic Packages UI. No 401.204on the run that overwrites a prior upload,404on the very first run when there is nothing to delete.