Skip to content

publish-package-repository: environment secrets resolve empty at v0.1.17 #67

Description

@jmgilman

Summary

publish-package-repository.yml reads its aggregate signing and R2 credentials from the packages-production environment:

    environment: packages-production
...
          gpg-private-key: ${{ secrets.PACKAGE_REPOSITORY_GPG_PRIVATE_KEY }}
          gpg-passphrase: ${{ secrets.PACKAGE_REPOSITORY_GPG_PASSPHRASE }}
          apk-private-key: ${{ secrets.PACKAGE_REPOSITORY_APK_PRIVATE_KEY }}

In a new adopter organization at v0.1.17 those expressions resolve to empty strings, and every publication fails at setup-package-repository with:

Error: GPG_PASSPHRASE is empty

The same three values resolve correctly in a non-reusable job in the same repository that selects the same environment, so the stored secrets are fine. Something about the reusable-workflow path is not receiving environment secrets.

Evidence

Adopter: componere/pkgs, receiver pinned to 0dee66ff6c4cc7e28d7bb65e97a37d701e0eff4a (v0.1.17), environment packages-production holding all five secrets, required reviewer, deployment_branch_policy: {protected_branches: true, custom_branch_policies: false}.

1. The secrets are correct at rest. A temporary direct job in the same repository, selecting the same environment, printing only lengths:

gpg_passphrase_len=32
gpg_private_key_len=4756
apk_private_key_len=4324
r2_key_id_len=32

2. Three receiver runs, same failure, with GPG_PRIVATE_KEY, GPG_PASSPHRASE, and APK_PRIVATE_KEY all empty in the action's env group:

  • repository_dispatch from the producer release, with secrets: inherit
  • workflow_dispatch with secrets: inherit removed, matching the documented caller in operate-a-native-package-repository.md
  • workflow_dispatch with secrets: inherit restored and a dummy repository-level secret added, to rule out an entirely empty inherited secret set

3. secrets: inherit is load-bearing but not sufficient. The documented caller template omits it, but meigma/pkgs commit 3193b8a5 is titled "fix(release): inherit publication secrets", so that repository hit the same failure and fixed it by adding secrets: inherit. Adding it here did not help.

4. The only difference from a working caller is the pinned SHA. componere/pkgs/.github/workflows/publish.yml and meigma/pkgs/.github/workflows/publish.yml differ by exactly one line:

-    uses: meigma/release/.github/workflows/publish-package-repository.yml@583937edadfbae183e49f16df46b98e0b36807ba # v0.1.16
+    uses: meigma/release/.github/workflows/publish-package-repository.yml@0dee66ff6c4cc7e28d7bb65e97a37d701e0eff4a # v0.1.17

meigma/pkgs published successfully at v0.1.16 today. Yet git diff v0.1.16 v0.1.17 -- .github/workflows/publish-package-repository.yml .github/actions/setup-package-repository/ is empty — those files are byte-identical between the two tags, and both declare environment: packages-production and read the same secret names.

Two possible causes, which I cannot separate from outside

  1. A v0.1.17 regression somewhere in the release unit outside those two files that changes how the receiver job is composed.
  2. A GitHub platform change to environment-secret resolution in reusable workflows, landing between meigma's 04:22Z success and componere's 17:30Z failure.

meigma/pkgs has a repository_dispatch run from 15:59Z still waiting for approval. Approving it settles this: if it fails identically at v0.1.16, cause 2; if it succeeds, cause 1.

Why this matters for adopters

This is the last step of the documented onboarding path, and it fails after the producer release is already public — the producer's GitHub Release, image, cask, and manifest all published successfully first. The only workaround I can see is moving the aggregate keys to repository-level secrets so secrets: inherit delivers them, which contradicts the guide's stated boundary that "aggregate private keys stay in the central protected environment."

Suggested changes

  1. Determine which cause applies, and if it is a regression, fix it and yank or document v0.1.17 for the package-repository path.
  2. Either way, make setup-package-repository fail with a message that names the likely cause. GPG_PASSPHRASE is empty reads as "the operator forgot to set a secret," which sent me to re-set correct secrets twice before I probed resolution directly.
  3. Consider having the receiver assert all five environment values up front and report which are empty together, rather than failing on the first one.
  4. State explicitly in operate-a-native-package-repository.md whether secrets: inherit is required in the caller. The template omits it and meigma/pkgs needs it; adopters currently have to guess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions