Repository navigation
Let a caller supply a credential for private cross-org dependencies - #30
Merged
Merged
Conversation
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.
Summary
A package may require a private repository in another owner through a
vcsrepository, which is laranail's documented way of resolving inter-package dependencies. The reusablesecurity.ymlcould not install such a package at all, so it could not scan it.Adds two optional inputs and one optional secret. A caller that sets none behaves exactly as before.
private-dependency-ownersimtabi). Empty by defaultprivate-dependency-reposREFRESH_APP_PRIVATE_KEYvars.REFRESH_APP_CLIENT_IDWhat it failed with, and why that matters
laranail/sis-wrapperrequiressimtabi/sis-sdk, which is private and in a different org:A workflow's
GITHUB_TOKENis scoped to the calling repository, so it cannot clone anything in another owner. The failure surfaces as an authentication error insidecomposer install— which reads as a dependency problem, several steps from its cause. sis-wrapper's own workflows already carry a comment saying exactly that, and already solve it; the shared workflow did not.Why the caller cannot just pass a token
A
jobs.<id>.uses:job runs no steps of its own, so a caller cannot mint an installation token and hand it over. The minting has to happen inside the reusable workflow. That is why this takes a private key and an owner rather than a ready-made token.Three details that are not optional
permission-contents: read, and nothing long-lived is stored.GITHUB_TOKENand producing the confusing clone failure above. A missing credential is a configuration fault and should say so.git config url.insteadOfis required, not belt-and-braces. Composer clones the plain https URL and offers the token as<token>:x-oauth-basic, which GitHub refuses for an app installation token. The rewrite supplies the documentedx-access-token:<token>form so the first attempt is the correct one. This is sis-wrapper's own hard-won finding, generalised.Verified
insteadOfrewrites — one set per composer-installing job (composer-audit,osv-scan);secret-scaninstalls nothing and needs none.composer-audit,osv-scan,secret-scanintact; inputs nowphp-version,php-extensions,private-dependency-owner,private-dependency-repos; secretsOP_SERVICE_ACCOUNT_TOKEN,REFRESH_APP_PRIVATE_KEY, both optional.actions/create-github-app-token@v3floats on its major tag, per the first-party rule.Follow-up
laranail/sis-wrapper#51 can then pass
private-dependency-owner: simtabiandprivate-dependency-repos: sis-sdk. Its local deploy-key path stays as it is; this is the app-token route only.