From d100da824cf599bfdd84794259539bced06d82c3 Mon Sep 17 00:00:00 2001 From: megamiley Date: Mon, 15 Jun 2026 12:16:16 +0000 Subject: [PATCH] Add action.yml --- action.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..8a481e3 --- /dev/null +++ b/action.yml @@ -0,0 +1,64 @@ +name: 'Gitea SSH Checkout' +description: 'Clones a repository via SSH on a custom port.' + +inputs: + ssh-key: + description: 'Private SSH Key' + required: true + ref: + description: 'Branch, tag, or commit SHA to checkout' + required: false + default: '' + repository: + description: 'Repository to clone (e.g., owner/repo)' + required: false + default: ${{ github.repository }} + host: + description: 'Git server hostname' + required: false + default: 'git.mmquack.nl' + port: + description: 'SSH port' + required: false + default: '2222' + +runs: + using: "composite" + steps: + - name: Run SSH Clone + shell: bash # Required for composite actions + env: + SSH_KEY: ${{ inputs.ssh-key }} + REF: ${{ inputs.ref }} + REPO: ${{ inputs.repository }} + HOST: ${{ inputs.host }} + PORT: ${{ inputs.port }} + run: | + # 1. Setup the SSH directory and private key + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "$SSH_KEY" > ~/.ssh/gitea_key + chmod 600 ~/.ssh/gitea_key + + # 2. Configure SSH for the custom port and bypass host key prompt + cat >> ~/.ssh/config <