I am using the continuous deployment by GitHub actions for 1 year or more everything was okay until yesterday when I pushed my updates I found an error in GitHub actions with this message:
can’t connect without a private SSH key or password
This is my yml code
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy repository contents via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
with:
source: "."
target: "/home/ubuntu/dev-folder"
- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
command_timeout: 10m
script: cd dev-folder;
mvn package install
I didn’t change anything in the yml file
Did GitHub change anything on its policy?
I searched and I didn’t find anything to solve my problem
2
Answers
I’m not familiar with those two appleboy actions but taking a quick look at the projects, there was a recent release of their base docker image that changes how env vars are getting used:
https://github.com/appleboy/drone-ssh/pull/252
Additionally, you’re using a very old / outdated version of the
actions/checkout@v1
I’d strongly recommend updating your config to handle the latest versions.
I finally found the solution here: https://github.com/appleboy/scp-action/issues/113
Change
to