I'm having trouble with a remote call of a github action. The issue concerns an action I created called nixosify which is designed to install my Linux distro of choice on a remote machine. The action accepts four parameters:
- target: ip of the machine to convert
- tempkey: private key to grant access to the target
- tempkey_pub: the temporary public key, used to add to the install medium
- authkey_pub: a permanent public key to add to authorized keys on the target, post install
As you can see in this successful execution of a test workflow this all seems good and well. The test workflow uses a VPS provider's CLI to create an test instance, run the test, and kill it.
The trouble starts whenever I try to use the action in a workflow in a seperate repository. First I tried to use the action on this repo which is supposed to deploy a minecraft server. The workflow run attempts fail due to SSH Connection refused
errors. This makes me suspect I am possibly passing the keys wrong; however, the calls of the action are practically identical except for the action being references elsewhere in the later case while being called locally in the former case.
To double check this is a reference issue, I clone the original repo and made the minimal modifications needed to make it work in the new context (see diff below), remembering to add all the needed secrets to both the repo and the VPS provider. Alas, the all-but-identical workflow fails in this new context, again with SSH Connection refused
errors.
The diff:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index e216eb5..19704f1 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,7 +1,7 @@
on: [push]
env:
- prefix: 'test-nixosifyB'
+ prefix: 'test-nixosify'
HCLOUD_TOKEN: ${{ secrets.hcloud_token }}
jobs:
@@ -34,7 +34,7 @@ jobs:
--name ${name} \
--type ${size} \
--image ${image} \
- --ssh-key nixosifyB
+ --ssh-key nixosify
ip=$(hcloud server describe ${name} -o json | jq -r .public_net.ipv4.ip)
host_info="${host_info}${name}\t${ip}\n"
done
@@ -48,7 +48,7 @@ jobs:
echo "$host_ip"
echo "::set-output name=host_ip::$host_ip"
- name: Test nixosify
- uses: sparkletco/nixosify@273e5e6
+ uses: ./
id: nixosify
with:
target: ${{ steps.get-host-ip.outputs.host_ip }}
Secrets are a per-repo setting. Has the
secrets.hcloud_token
been setup for the second repo? It isn't clear from this gist that is the case.