daniel/gitdan-crates is a private repo of shared Rust crates. Consumers (director, emowheel, lublub, zemyna) depend on it as a git dependency over ssh://git@gitdan.com:22022/daniel/gitdan-crates.git, with [net] git-fetch-with-cli = true, so Cargo fetches through the git CLI.
The Actions job token cannot read it: a probe job in emowheel read its own repo with github.token and failed on gitdan-crates. CI therefore needs a read-only deploy key. Its private half will be a user-level Actions secret, GITDAN_CRATES_DEPLOY_KEY (gitdan#123 creates and rotates it).
Scope
A composite action, gitdan-crates-access, that a consumer workflow calls once before any cargo step:
Writes the key to a 0600 file outside the workspace, and a known-hosts file pinning gitdan.com's SSH host key for port 22022.
Exports GIT_SSH_COMMAND through $GITHUB_ENV, using only that key and that known-hosts file with strict host-key checking, so every later step's git (and Cargo through it) authenticates. Not a CARGO_* variable: those split sccache keys.
Proves access at once with git ls-remote on gitdan-crates, so a missing or revoked key fails here with a message naming the secret, not deep inside a cargo fetch.
Checks Cargo.lock (path is an input, default Cargo.lock): fails when it lists more than one commit of the gitdan-crates source, since two commits mean two copies of a shared type. No entry at all passes.
Acceptance criteria
The key never appears in a log, in argv, or in the workspace.
An empty deploy-key input fails with a message that names GITDAN_CRATES_DEPLOY_KEY.
The pinned host key matches the forge's real one, checked against an existing trusted record, not only a fresh ssh-keyscan.
The lockfile check has a selftest wired into this repo's existing selftest run: one commit passes, two fail, none passes.
README documents the action, its input, and what to do when the host key changes.
Out of scope
Creating or rotating the key (gitdan#123).
Adding the step to consumer workflows; each consumer's adoption PR does that.
Notes for agent
The live ls-remote cannot be exercised until the owner has created the secret. Test what can be tested offline, and say in the PR what remains unproven until the first consumer run.
## Context
`daniel/gitdan-crates` is a private repo of shared Rust crates. Consumers (director, emowheel, lublub, zemyna) depend on it as a git dependency over `ssh://git@gitdan.com:22022/daniel/gitdan-crates.git`, with `[net] git-fetch-with-cli = true`, so Cargo fetches through the `git` CLI.
The Actions job token cannot read it: a probe job in emowheel read its own repo with `github.token` and failed on gitdan-crates. CI therefore needs a read-only deploy key. Its private half will be a user-level Actions secret, `GITDAN_CRATES_DEPLOY_KEY` (gitdan#123 creates and rotates it).
## Scope
A composite action, `gitdan-crates-access`, that a consumer workflow calls once before any cargo step:
```yaml
- uses: https://gitdan.com/daniel/gitdan-actions/gitdan-crates-access@v1
with:
deploy-key: ${{ secrets.GITDAN_CRATES_DEPLOY_KEY }}
```
It:
1. Writes the key to a `0600` file outside the workspace, and a known-hosts file pinning gitdan.com's SSH host key for port 22022.
2. Exports `GIT_SSH_COMMAND` through `$GITHUB_ENV`, using only that key and that known-hosts file with strict host-key checking, so every later step's `git` (and Cargo through it) authenticates. Not a `CARGO_*` variable: those split sccache keys.
3. Proves access at once with `git ls-remote` on gitdan-crates, so a missing or revoked key fails here with a message naming the secret, not deep inside a cargo fetch.
4. Checks `Cargo.lock` (path is an input, default `Cargo.lock`): fails when it lists more than one commit of the gitdan-crates source, since two commits mean two copies of a shared type. No entry at all passes.
## Acceptance criteria
- The key never appears in a log, in argv, or in the workspace.
- An empty `deploy-key` input fails with a message that names `GITDAN_CRATES_DEPLOY_KEY`.
- The pinned host key matches the forge's real one, checked against an existing trusted record, not only a fresh `ssh-keyscan`.
- The lockfile check has a selftest wired into this repo's existing selftest run: one commit passes, two fail, none passes.
- README documents the action, its input, and what to do when the host key changes.
## Out of scope
- Creating or rotating the key (gitdan#123).
- Adding the step to consumer workflows; each consumer's adoption PR does that.
## Notes for agent
The live `ls-remote` cannot be exercised until the owner has created the secret. Test what can be tested offline, and say in the PR what remains unproven until the first consumer run.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
daniel/gitdan-cratesis a private repo of shared Rust crates. Consumers (director, emowheel, lublub, zemyna) depend on it as a git dependency overssh://git@gitdan.com:22022/daniel/gitdan-crates.git, with[net] git-fetch-with-cli = true, so Cargo fetches through thegitCLI.The Actions job token cannot read it: a probe job in emowheel read its own repo with
github.tokenand failed on gitdan-crates. CI therefore needs a read-only deploy key. Its private half will be a user-level Actions secret,GITDAN_CRATES_DEPLOY_KEY(gitdan#123 creates and rotates it).Scope
A composite action,
gitdan-crates-access, that a consumer workflow calls once before any cargo step:It:
0600file outside the workspace, and a known-hosts file pinning gitdan.com's SSH host key for port 22022.GIT_SSH_COMMANDthrough$GITHUB_ENV, using only that key and that known-hosts file with strict host-key checking, so every later step'sgit(and Cargo through it) authenticates. Not aCARGO_*variable: those split sccache keys.git ls-remoteon gitdan-crates, so a missing or revoked key fails here with a message naming the secret, not deep inside a cargo fetch.Cargo.lock(path is an input, defaultCargo.lock): fails when it lists more than one commit of the gitdan-crates source, since two commits mean two copies of a shared type. No entry at all passes.Acceptance criteria
deploy-keyinput fails with a message that namesGITDAN_CRATES_DEPLOY_KEY.ssh-keyscan.Out of scope
Notes for agent
The live
ls-remotecannot be exercised until the owner has created the secret. Test what can be tested offline, and say in the PR what remains unproven until the first consumer run.