### Basic SSH Agent Setup in GitHub Actions Source: https://context7.com/webfactory/ssh-agent/llms.txt Sets up an SSH agent with a private key and custom binary paths for Git operations. This is useful for cloning private repositories directly within a workflow step. ```yaml name: Build with Custom SSH Binaries on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-agent-cmd: /usr/local/bin/ssh-agent ssh-add-cmd: /usr/local/bin/ssh-add git-cmd: /usr/local/bin/git - run: git clone git@github.com:myorg/private-repo.git ``` -------------------------------- ### Dockerfile for Private Dependency Installation Source: https://context7.com/webfactory/ssh-agent/llms.txt A Dockerfile snippet that copies SSH/Git configurations and installs private npm dependencies using an SSH agent. Ensure the `root-config` directory is prepared in the build context. ```dockerfile # Dockerfile FROM node:18 # Copy SSH/Git configuration and fix paths for container COPY root-config /root/ RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config # Now private dependencies can be installed RUN --mount=type=ssh npm install ``` -------------------------------- ### Docker Build with SSH Agent Access Source: https://context7.com/webfactory/ssh-agent/llms.txt Enables Docker builds to access private repositories by passing the SSH agent socket. This allows installing private dependencies during the image build process. ```yaml # .github/workflows/docker-build-workflow.yml name: Docker Build with SSH on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # Pass SSH socket to docker build - run: | docker build --ssh default=${{ env.SSH_AUTH_SOCK }} -t myimage . # Or with docker-compose - run: | DOCKER_BUILDKIT=1 docker compose build --ssh default=${{ env.SSH_AUTH_SOCK }} ``` -------------------------------- ### Mapping Deploy Keys to Repositories Source: https://context7.com/webfactory/ssh-agent/llms.txt Uses key comments to map specific deploy keys to repositories, ensuring the correct key is selected. ```bash # Generate a deploy key with repository URL in comment ssh-keygen -t ed25519 -a 100 -f ./deploy-key -C "git@github.com:owner/repo.git" # For RSA keys (older servers) ssh-keygen -t rsa -b 4096 -o -f ./deploy-key -C "git@github.com:owner/repo.git" ``` ```yaml # .github/workflows/deploy-keys-workflow.yml name: Build with Deploy Keys on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # Keys with repository URL comments are automatically mapped - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.DEPLOY_KEY_REPO_A }} ${{ secrets.DEPLOY_KEY_REPO_B }} # The correct key is automatically selected for each repository - run: | git clone git@github.com:myorg/repo-a.git git clone git@github.com:myorg/repo-b.git ``` -------------------------------- ### Docker Build with Multiple Deploy Keys Source: https://context7.com/webfactory/ssh-agent/llms.txt This workflow demonstrates how to use multiple deploy keys with the ssh-agent action and prepare the SSH configuration for Docker builds. ```APIDOC ## Docker Build with Multiple Deploy Keys Copies Git and SSH configuration to Docker build context when using multiple deploy keys. ### Method Uses the `webfactory/ssh-agent` action, `docker/build-push-action`, and manual configuration copying. ### Endpoint N/A (Action and Docker build action) ### Parameters #### Action Inputs - **ssh-private-key** (string) - Required - Multiple private SSH keys to load into the agent, separated by newlines. #### Docker Build Action Inputs - **context** (string) - Path to the build context. Default: ".". - **ssh** (string) - SSH agent socket to use for the build. Example: `default=${{ env.SSH_AUTH_SOCK }}`. - **push** (boolean) - Whether to push the image after building. Default: `false`. - **tags** (string) - Tags to apply to the built image. Example: `myimage:latest`. ### Request Example ```yaml - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.DEPLOY_KEY_LIB_A }} ${{ secrets.DEPLOY_KEY_LIB_B }} # Collect Git and SSH configs for Docker build context - name: Prepare SSH config for Docker run: | mkdir root-config cp -r ~/.gitconfig ~/.ssh root-config/ - name: Build Docker image uses: docker/build-push-action@v2 with: context: . ssh: | default=${{ env.SSH_AUTH_SOCK }} push: false tags: myimage:latest ``` ### Dockerfile Configuration ```dockerfile FROM node:18 # Copy SSH/Git configuration and fix paths for container COPY root-config /root/ RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config # Now private dependencies can be installed RUN --mount=type=ssh npm install ``` ### Response #### Exported Environment Variables - **SSH_AUTH_SOCK** (string) - Path to the SSH agent socket. #### Response Example N/A (Docker image is built) ``` -------------------------------- ### Build with Custom SSH Binaries Source: https://context7.com/webfactory/ssh-agent/llms.txt This workflow demonstrates how to use the ssh-agent action with custom paths for ssh-agent, ssh-add, and git binaries, enabling cloning of private repositories. ```APIDOC ## Build with Custom SSH Binaries This workflow demonstrates how to use the ssh-agent action with custom paths for ssh-agent, ssh-add, and git binaries, enabling cloning of private repositories. ### Method Uses the `webfactory/ssh-agent` action. ### Endpoint N/A (Action) ### Parameters #### Action Inputs - **ssh-private-key** (string) - Required - Private SSH key(s) to load into the agent. - **ssh-agent-cmd** (string) - Optional - Custom path to ssh-agent binary. Default: `ssh-agent`. - **ssh-add-cmd** (string) - Optional - Custom path to ssh-add binary. Default: `ssh-add`. - **git-cmd** (string) - Optional - Custom path to git binary. Default: `git`. ### Request Example ```yaml - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" ssh-agent-cmd: "/usr/local/bin/ssh-agent" ssh-add-cmd: "/usr/local/bin/ssh-add" git-cmd: "/usr/local/bin/git" ``` ### Response #### Exported Environment Variables - **SSH_AUTH_SOCK** (string) - Path to the SSH agent socket. - **SSH_AGENT_PID** (string) - Process ID of the running SSH agent. #### Response Example N/A (Environment Variables are set for subsequent steps) ``` -------------------------------- ### Swift Package Manager with Deploy Keys Source: https://context7.com/webfactory/ssh-agent/llms.txt This workflow configures Xcode to use the system Git for proper deploy key support in Swift projects, utilizing the ssh-agent action. ```APIDOC ## Swift Package Manager with Deploy Keys Configures Xcode to use system Git for proper deploy key support in Swift projects. ### Method Uses the `webfactory/ssh-agent` action and `xcodebuild` command with specific arguments. ### Endpoint N/A (Action and Xcode build command) ### Parameters #### Action Inputs - **ssh-private-key** (string) - Required - Private SSH key(s) to load into the agent. #### Xcode Build Arguments - **-scheme** (string) - The scheme to build. - **-scmProvider system** - Configures Xcode to use the system's Git provider, enabling deploy key URL remapping. ### Request Example ```yaml - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.DEPLOY_KEY_PACKAGE_A }} ${{ secrets.DEPLOY_KEY_PACKAGE_B }} # Use -scmProvider system for deploy key URL remapping support - name: Build with Xcode run: | xcodebuild -scheme MyApp -scmProvider system build ``` ### Response #### Exported Environment Variables - **SSH_AUTH_SOCK** (string) - Path to the SSH agent socket. #### Response Example N/A (Swift project is built) ``` -------------------------------- ### Run Action with SSH Key Input (Windows CMD) Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass the SSH private key content to the action using an environment variable on Windows Command Prompt. ```cmd set /P INPUT_SSH-PRIVATE-KEY=< file node index.js ``` -------------------------------- ### Action Inputs Reference Source: https://context7.com/webfactory/ssh-agent/llms.txt Provides a complete reference for all available inputs for the webfactory/ssh-agent action. ```APIDOC ## Action Inputs Reference Complete reference for all available action inputs. | Input | Required | Default | Description | |---|---|---|---| | `ssh-private-key` | Yes | - | Private SSH key(s) to load into the agent | | `ssh-auth-sock` | No | Auto-generated | Custom path for SSH agent socket | | `log-public-key` | No | `true` | Whether to log public key fingerprints | | `ssh-agent-cmd` | No | `ssh-agent` | Custom path to ssh-agent binary | | `ssh-add-cmd` | No | `ssh-add` | Custom path to ssh-add binary | | `git-cmd` | No | `git` | Custom path to git binary | ``` -------------------------------- ### SSH Agent Action Inputs Reference Source: https://context7.com/webfactory/ssh-agent/llms.txt Provides a complete reference for all available inputs to the webfactory/ssh-agent action, including required fields, defaults, and descriptions. ```yaml # Action Inputs Reference | Input | Required | Default | Description | |---|---|---|---| | `ssh-private-key` | Yes | - | Private SSH key(s) to load into the agent | | `ssh-auth-sock` | No | Auto-generated | Custom path for SSH agent socket | | `log-public-key` | No | `true` | Whether to log public key fingerprints | | `ssh-agent-cmd` | No | `ssh-agent` | Custom path to ssh-agent binary | | `ssh-add-cmd` | No | `ssh-add` | Custom path to ssh-add binary | | `git-cmd` | No | `git` | Custom path to git binary | ``` -------------------------------- ### Swift Package Manager with Deploy Keys Source: https://context7.com/webfactory/ssh-agent/llms.txt Configures Xcode to use the system Git provider for deploy key support in Swift projects. This is essential for accessing private Swift packages during the build process. ```yaml # .github/workflows/swift-deploy-keys-workflow.yml name: Swift Build with Deploy Keys on: push: branches: [main] jobs: build: runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.DEPLOY_KEY_PACKAGE_A }} ${{ secrets.DEPLOY_KEY_PACKAGE_B }} # Use -scmProvider system for deploy key URL remapping support - name: Build with Xcode run: | xcodebuild -scheme MyApp -scmProvider system build ``` -------------------------------- ### Docker Build with Multiple Deploy Keys Source: https://context7.com/webfactory/ssh-agent/llms.txt Configures the SSH agent with multiple deploy keys and prepares SSH/Git configurations for a Docker build context. This is useful when accessing multiple private repositories with different keys. ```yaml # .github/workflows/docker-multikey-workflow.yml name: Docker Build with Multiple Deploy Keys on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.DEPLOY_KEY_LIB_A }} ${{ secrets.DEPLOY_KEY_LIB_B }} # Collect Git and SSH configs for Docker build context - name: Prepare SSH config for Docker run: | mkdir root-config cp -r ~/.gitconfig ~/.ssh root-config/ - name: Build Docker image uses: docker/build-push-action@v2 with: context: . ssh: | default=${{ env.SSH_AUTH_SOCK }} push: false tags: myimage:latest ``` -------------------------------- ### Loading Multiple SSH Keys Source: https://context7.com/webfactory/ssh-agent/llms.txt Configures multiple private keys to be tried sequentially for different repositories. ```yaml # .github/workflows/multi-key-workflow.yml name: Build with Multiple Private Repos on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.FIRST_KEY }} ${{ secrets.SECOND_KEY }} ${{ secrets.THIRD_KEY }} # All keys are tried in order when establishing SSH connections - run: | git clone git@github.com:myorg/repo-one.git git clone git@github.com:myorg/repo-two.git git clone git@github.com:myorg/repo-three.git ``` -------------------------------- ### Run Action with SSH Key Input (Unix) Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass the SSH private key content to the action using an environment variable on Unix-like systems. ```bash env "INPUT_SSH-PRIVATE-KEY=\`cat file\`" node index.js ``` -------------------------------- ### Rust Cargo with Private Dependencies on Windows Source: https://context7.com/webfactory/ssh-agent/llms.txt This workflow configures Cargo to use the Git CLI for cloning private dependencies on Windows runners, leveraging the ssh-agent action. ```APIDOC ## Rust Cargo with Private Dependencies on Windows Configures Cargo to use Git CLI for cloning private dependencies on Windows runners. ### Method Uses the `webfactory/ssh-agent` action and configures Cargo environment variables. ### Endpoint N/A (Action and Cargo configuration) ### Parameters #### Action Inputs - **ssh-private-key** (string) - Required - Private SSH key(s) to load into the agent. #### Environment Variables - **CARGO_NET_GIT_FETCH_WITH_CLI** (boolean) - Set to `true` to enable Git CLI for fetching dependencies. ### Request Example ```yaml jobs: build: runs-on: windows-latest env: CARGO_NET_GIT_FETCH_WITH_CLI: true steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" # Alternative: configure cargo per-job - name: Configure Cargo for Git CLI run: | Set-Content -Path $env:USERPROFILE\.cargo\config.toml "[net]`ngit-fetch-with-cli = true" - name: Build run: cargo build --release ``` ### Cargo.toml Example ```toml [dependencies] private-lib = { git = "ssh://git@github.com/myorg/private-lib.git", branch = "main" } ``` ### Response #### Exported Environment Variables - **SSH_AUTH_SOCK** (string) - Path to the SSH agent socket. #### Response Example N/A (Rust project is built) ``` -------------------------------- ### Collect Git and SSH Config for Docker Builds Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Copy Git and SSH configuration files into a directory that will be part of the Docker build context. This is necessary when using multiple deploy keys with Docker builds to ensure Git can select the correct key. ```yaml - name: Collect Git and SSH config files in a directory that is part of the Docker build context run: | mkdir root-config cp -r ~/.gitconfig ~/.ssh root-config/ ``` -------------------------------- ### Generate SSH Key with Repository Comment Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Use this command to create an SSH key with a comment containing the repository URL, which allows the action to automatically select the correct key. ```bash ssh-keygen ... -C "git@github.com:owner/repo.git" ``` -------------------------------- ### Basic SSH Agent Usage Source: https://context7.com/webfactory/ssh-agent/llms.txt Loads a single SSH private key to enable git operations and SSH connections. ```yaml # .github/workflows/my-workflow.yml name: Build with Private Dependencies on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # Now git clone via SSH works automatically - run: git clone git@github.com:myorg/private-repo.git # SSH connections also work - run: ssh user@server.example.com "echo 'Connected!'" ``` -------------------------------- ### Configure xcodebuild for System SCM Provider Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass '-scmProvider system' to the xcodebuild command when using GitHub Deploy Keys with Swift Package Manager. This ensures that xcodebuild uses the system's Git tooling, which supports the necessary URL remapping. ```bash -scmProvider system ``` -------------------------------- ### Configure SSH Agent in Workflow Source: https://context7.com/webfactory/ssh-agent/llms.txt Use this step to initialize the SSH agent and expose the socket and PID variables for subsequent steps. ```yaml - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - run: | echo "Agent socket: $SSH_AUTH_SOCK" echo "Agent PID: $SSH_AGENT_PID" # Forward socket to Docker container docker run -v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent myimage ``` -------------------------------- ### Docker Build with SSH Agent Source: https://context7.com/webfactory/ssh-agent/llms.txt This workflow shows how to pass the SSH agent socket to Docker builds, allowing access to private repositories during the image building process. ```APIDOC ## Docker Build with SSH Agent Passes the SSH agent socket to Docker builds for accessing private repositories during image building. ### Method Uses the `webfactory/ssh-agent` action and `docker build` command. ### Endpoint N/A (Action and Docker command) ### Parameters #### Action Inputs - **ssh-private-key** (string) - Required - Private SSH key(s) to load into the agent. #### Docker Build Arguments - **--ssh default=${{ env.SSH_AUTH_SOCK }}** - Injects the SSH agent socket into the Docker build context. ### Request Example ```yaml - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" # Pass SSH socket to docker build - run: | docker build --ssh default=${{ env.SSH_AUTH_SOCK }} -t myimage . # Or with docker-compose - run: | DOCKER_BUILDKIT=1 docker compose build --ssh default=${{ env.SSH_AUTH_SOCK }} ``` ### Response #### Exported Environment Variables - **SSH_AUTH_SOCK** (string) - Path to the SSH agent socket. #### Response Example N/A (Docker image is built) ``` -------------------------------- ### Run Action with SSH Key Input (Windows PowerShell) Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass the SSH private key content to the action using an environment variable on Windows PowerShell. ```powershell ${env:INPUT_SSH-PRIVATE-KEY} = (Get-Content .\test-keys -Raw); node index.js ``` -------------------------------- ### Configure Cargo to Use Git CLI on Windows Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Update Cargo's configuration to use the Git CLI for fetching private dependencies on Windows. This is an alternative to setting environment variables for the entire workflow. ```powershell - name: Update cargo config to use Git CLI run: Set-Content -Path $env:USERPROFILE\.cargo\config.toml "[net]`ngit-fetch-with-cli = true" ``` -------------------------------- ### Generate SSH Key (RSA) Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Use this command to generate a new RSA SSH key, suitable for older server software. Ensure the key is created without a passphrase for use with the action. ```bash ssh-keygen -t rsa -b 4096 -o -f path/to/keyfile ``` -------------------------------- ### Configure Docker Build-Push Action with SSH Agent Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass the SSH agent socket to the docker/build-push-action to allow Docker builds to use the loaded SSH keys. ```yaml - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: ssh: | default=${{ env.SSH_AUTH_SOCK }} ``` -------------------------------- ### Convert SSH Key to PEM Format Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Use this command to convert an existing SSH private key to the required PEM format if the action reports an invalid format error. ```bash ssh-keygen -p -f path/to/your/key -m pem ``` -------------------------------- ### Rust Cargo with Private Dependencies on Windows Source: https://context7.com/webfactory/ssh-agent/llms.txt Configures Cargo to use the Git CLI for cloning private dependencies on Windows runners. This involves setting an environment variable and optionally configuring Cargo locally. ```yaml # .github/workflows/rust-windows-workflow.yml name: Rust Build on Windows on: push: branches: [main] jobs: build: runs-on: windows-latest env: CARGO_NET_GIT_FETCH_WITH_CLI: true steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # Alternative: configure cargo per-job - name: Configure Cargo for Git CLI run: | Set-Content -Path $env:USERPROFILE\.cargo\config.toml "[net]`ngit-fetch-with-cli = true" - name: Build run: cargo build --release ``` -------------------------------- ### Load multiple SSH keys Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Pass multiple secrets to the ssh-private-key input to load several keys into the agent. ```yaml # ... contents as before - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: | ${{ secrets.FIRST_KEY }} ${{ secrets.NEXT_KEY }} ${{ secrets.ANOTHER_KEY }} ``` -------------------------------- ### Cargo.toml with Private Dependencies Source: https://context7.com/webfactory/ssh-agent/llms.txt Specifies a private Rust library dependency using its Git SSH URL. Ensure the SSH agent is configured correctly to allow access to the private repository. ```toml # Cargo.toml with private dependencies [dependencies] private-lib = { git = "ssh://git@github.com/myorg/private-lib.git", branch = "main" } ``` -------------------------------- ### Copy Config Files into Docker Image Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Copy the collected Git and SSH configuration files into the Docker image and adjust paths if necessary. This step ensures that Git within the container can access the configuration. ```Dockerfile # Copy the two files in place and fix different path/locations inside the Docker image COPY root-config /root/ RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config ``` -------------------------------- ### Generate SSH Keys for GitHub Actions Source: https://context7.com/webfactory/ssh-agent/llms.txt Commands to generate secure SSH keys without passphrases for use in GitHub Secrets. ```bash # Recommended: Ed25519 key (modern, secure, fast) ssh-keygen -t ed25519 -a 100 -f ./github-action-key -C "git@github.com:owner/repo.git" # Alternative: RSA key (for older server compatibility) ssh-keygen -t rsa -b 4096 -o -f ./github-action-key -C "git@github.com:owner/repo.git" # IMPORTANT: Do NOT set a passphrase when prompted # The key must be usable without interactive input # View the public key to add as deploy key cat ./github-action-key.pub # Add the private key content to GitHub Secrets cat ./github-action-key ``` -------------------------------- ### Configure ssh-agent in workflow Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Add this step to your workflow file to load a private SSH key from GitHub Secrets. ```yaml # .github/workflows/my-workflow.yml jobs: my_job: ... steps: - uses: actions/checkout@v4 # Make sure the @v0.9.0 matches the current version of the action - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} # ... other steps ``` -------------------------------- ### Exported Environment Variables Source: https://context7.com/webfactory/ssh-agent/llms.txt Lists the environment variables exported by the webfactory/ssh-agent action for use in subsequent workflow steps. ```APIDOC ## Exported Environment Variables The action exports these environment variables for use in subsequent steps. | Variable | Description | |----------|-------------| | `SSH_AUTH_SOCK` | Path to the SSH agent socket | | `SSH_AGENT_PID` | Process ID of the running SSH agent | ``` -------------------------------- ### Generate SSH Key (Ed25519) Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Use this command to generate a new Ed25519 SSH key. Ensure the key is created without a passphrase for use with the action. ```bash ssh-keygen -t ed25519 -a 100 -f path/to/keyfile ``` -------------------------------- ### SSH Agent Action Exported Environment Variables Source: https://context7.com/webfactory/ssh-agent/llms.txt Lists the environment variables exported by the webfactory/ssh-agent action, which can be used in subsequent steps of a GitHub Actions workflow. ```yaml # Exported Environment Variables | Variable | |---| | `SSH_AUTH_SOCK` | Path to the SSH agent socket | | `SSH_AGENT_PID` | Process ID of the running SSH agent | ``` -------------------------------- ### Set Cargo Git Fetch CLI Environment Variable Source: https://github.com/webfactory/ssh-agent/blob/master/README.md Set the CARGO_NET_GIT_FETCH_WITH_CLI environment variable to true to configure Cargo to use the Git CLI for fetching private dependencies. This applies the setting for the entire workflow. ```yaml env: CARGO_NET_GIT_FETCH_WITH_CLI: true ``` -------------------------------- ### Custom SSH Auth Socket Location Source: https://context7.com/webfactory/ssh-agent/llms.txt Configures a specific path for the SSH agent socket. ```yaml # .github/workflows/custom-socket-workflow.yml name: Build with Custom Socket on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-auth-sock: /tmp/ssh_agent.sock # Socket is available at custom location - run: echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" # Output: SSH_AUTH_SOCK=/tmp/ssh_agent.sock ``` -------------------------------- ### Suppressing Public Key Logging Source: https://context7.com/webfactory/ssh-agent/llms.txt Disables the logging of public key fingerprints for privacy. ```yaml # .github/workflows/private-logging-workflow.yml name: Build without Key Logging on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} log-public-key: false - run: git clone git@github.com:myorg/private-repo.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.