如何在非交互式密码请求中将文件复制到sourceforge?

如何在非交互式密码请求中将文件复制到sourceforge?

我想使用 GitHub Actions 自动将文件复制到 Sourceforge。

在非交互模式下复制文件时遇到问题。例如: scp <file on laptop> <folder in sourceforge host>无需密码,可通过 Github Action 或任何其他 CI 进行操作。

我需要一种无需交互式密码请求即可将文件复制到 sourceforge 的方法。

GitHub 操作中的错误:

Please provide password for USERNAME,[email protected]
Pseudo-terminal will not be allocated because stdin is not a terminal.
Host key verification failed.
Error: Process completed with exit code 255.

答案1

这里有一个github 行动(appleboy/scp-action) 用于复制文件 vi scp

使用:

name: scp files
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: copy file via ssh password
      uses: appleboy/scp-action@master
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        password: ${{ secrets.PASSWORD }}
        port: ${{ secrets.PORT }}
        source: "tests/a.txt,tests/b.txt"
        target: "test"

相关内容