#!/usr/bin/env sh if ! command -v git > /dev/null; then echo "git is not installed" exit 1 fi if ! command -v curl > /dev/null; then echo "curl is not installed" exit 1 fi if ! command -v jq > /dev/null; then echo "jq is not installed" exit 1 fi mkdir -p ~/.ssh/git-commit-signing echo "Downloading SSH key" ssh_key=$(curl --request GET \ --url "${CODER_AGENT_URL}api/v2/workspaceagents/me/gitsshkey" \ --header "Coder-Session-Token: ${CODER_AGENT_TOKEN}") jq --raw-output ".public_key" > ~/.ssh/git-commit-signing/coder.pub < ~/.ssh/git-commit-signing/coder <