Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.
23 changes: 23 additions & 0 deletions setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
)
28 changes: 4 additions & 24 deletions ssh/action.yml
Original file line number Diff line number Diff line change
@@ -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."
Loading