name: 'gitdan-crates access' description: >- Gives the job read access to the private daniel/gitdan-crates repo over SSH with a read-only deploy key: pins the forge's host key, exports GIT_SSH_COMMAND so every later git (and Cargo, with net.git-fetch-with-cli) authenticates, proves access with git ls-remote, and checks that Cargo.lock holds one commit of the crates. author: 'gitdan' inputs: deploy-key: description: >- Private half of the read-only deploy key: pass ${{ secrets.GITDAN_CRATES_DEPLOY_KEY }}. Never echoed, never in argv. required: true lockfile: description: >- Path to the Cargo.lock to check, relative to the workspace. Fails when it lists more than one commit of the gitdan-crates source; no entry passes. A missing file fails; set to an empty string to skip the check. required: false default: 'Cargo.lock' runs: using: 'composite' steps: # The key reaches the script through the environment, never as an argument # or interpolated into the script text, so it cannot show up in argv or in # the step's echoed command. - shell: bash env: DEPLOY_KEY: ${{ inputs.deploy-key }} run: | set -euo pipefail bash "$(cd "${{ github.action_path }}/.." && pwd)/scripts/crates-access.sh" - if: ${{ inputs.lockfile != '' }} shell: bash env: LOCKFILE: ${{ inputs.lockfile }} run: | set -euo pipefail bash "$(cd "${{ github.action_path }}/.." && pwd)/scripts/crates-lock-check.sh" "$LOCKFILE"