appleboy / drone-git-push

Drone plugin for deploying code using git push
Apache License 2.0
66 stars 36 forks source link

Woodpecker SSH push #58

Closed MB175 closed 1 year ago

MB175 commented 1 year ago

Environment 1:

Secret has been set ssh_key, with rsa or ed key same result.

I also tried to change the line endings of the keys with sed, no luck.

sed ':b;N;$!bb;s/\n/\\n/g'

.woodpecker.yml


pipeline:
  publish:
    image: appleboy/drone-git-push
    settings:
      branch: main
      remote: git@github.com:<removed>
      force: false
      commit: true
      commit_message: "Drone build ${DRONE_COMMIT_SHA:0:7}"
      author_name: "John Doe"
      author_email: "johndoe123@example.com"
      ssh_key:
        from_secret: ssh_key
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Load key "/root/.ssh/id_rsa": invalid format
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Environment 2:

Same as in Environment 1 just without the definition of the secret name.

.woodpecker.yml


pipeline:
...
...
      author_email: "johndoe123@example.com"
      #ssh_key:
      # from_secret: ssh_key
Host key verification failed.
fatal: Could not read from remote repository.

TheKingDave commented 1 year ago

Had the same issue. Make sure the secret ends with an newline (\n)

https://serverfault.com/a/960647

MB175 commented 1 year ago

Had the same issue. Make sure the secret ends with an newline (\n)

https://serverfault.com/a/960647

I tried that, still the same issue /n unix line ending should be fine right ?

MB175 commented 1 year ago

Recreated everything including new keys on GitHub, Environment 1 is now working.