From 2b759ad91abf528a6622269e05ad96dc82033e54 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Sat, 11 Oct 2025 01:15:49 +0900 Subject: [PATCH] Merge `ssh` action into `setup` action `lima-vm/lima-actions/ssh` action is now deprecated and NOP, as the feature is merged into `lima-vm/lima-actions/setup`. Fix issue 3 Signed-off-by: Akihiro Suda --- README.md | 6 +----- setup/action.yml | 23 +++++++++++++++++++++++ ssh/action.yml | 28 ++++------------------------ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 95730a4..6f03398 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ steps: - run: limactl start --plain --name=default --cpus=1 --memory=1 template://fedora - - uses: lima-vm/lima-actions/ssh@v1 - - run: rsync -a -e ssh . lima-default:/tmp/repo - run: ssh lima-default ls -l /tmp/repo @@ -29,6 +27,4 @@ steps: ### `lima-vm/lima-actions/setup` - `version` (string): Lima version. e.g., "latest", "v1.0.6". Defaults to "latest". - `additional_guestagents` (boolean): Install lima-additional-guestagents. Usually not needed. Defaults to `false`. - -### `lima-vm/lima-actions/ssh` -None +- `ssh` (boolean): Setup `~/.ssh/config`. Defaults to `true`. Previously, this was a separate action `lima-vm/lima-actions/setup-ssh@v1`. \ No newline at end of file diff --git a/setup/action.yml b/setup/action.yml index 22261e7..baaad2b 100644 --- a/setup/action.yml +++ b/setup/action.yml @@ -11,6 +11,10 @@ inputs: type: boolean default: false description: "Install lima-additional-guestagents. Usually not needed." + ssh: + type: boolean + default: true + description: "Enable SSH support. Previously, this was a separate action `lima-vm/lima-actions/setup-ssh@v1`." outputs: version: description: "Resolved Lima version." @@ -62,3 +66,22 @@ runs: gh attestation verify --owner=lima-vm "${FILE}" sudo tar Cxzf /usr/local "${FILE}" rm -f "${FILE}" + - name: "Set up SSH" + id: setup-ssh + # fromJSON is needed here for booleans + if: ${{ fromJSON(inputs.ssh) }} + shell: bash + run: | + set -eux -o pipefail + mkdir -p -m 0700 ~/.ssh + cd ~/.ssh + ( + if [ -e config ]; then + # "Include" must be in the top section of the config + echo 'Include ~/.lima/*/ssh.config' > config.tmp + cat config >> config.tmp + mv config.tmp config + else + echo 'Include ~/.lima/*/ssh.config' > config + fi + ) \ No newline at end of file diff --git a/ssh/action.yml b/ssh/action.yml index a921361..51ff773 100644 --- a/ssh/action.yml +++ b/ssh/action.yml @@ -1,32 +1,12 @@ # SPDX-FileCopyrightText: Copyright The Lima Authors # SPDX-License-Identifier: Apache-2.0 -name: "Set up SSH" -description: "Set up SSH" +name: "Set up SSH (Deprecated, as the feature is merged into `setup` action)" +description: "Set up SSH (Deprecated, as the feature is merged into `setup` action)" runs: using: "composite" steps: - - name: "Set up SSH" + - name: "NOP" id: setup-ssh shell: bash - run: | - set -eux -o pipefail - mkdir -p -m 0700 ~/.ssh - ( - cd ~/.lima - for f in $(ls | grep -v ^_); do - config="$(pwd)/${f}/ssh.config" - [ -e "${config}" ] && echo "Include ${config}" >> ~/.ssh/config.tmp - done - ) - ( - cd ~/.ssh - if [ -e config ]; then - # "Include" must be in the top section of the config - cat config.tmp config > config.tmp2 - mv config.tmp2 config - else - mv config.tmp config - fi - rm -f config.tmp* - ) + run: echo "::warning::lima-vm/lima-actions/ssh is deprecated, as the feature is merged into lima-vm/lima-actions/setup." \ No newline at end of file