appleboy / appleboy/scp-action

How to use env variable in target?

Open
#94 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.6k
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Is it possible to use an env variable in target?
```
env:
SRV_HOME: /home/ubuntu

steps:
- uses: actions/download-artifact@v2
with:
name: app-build

- name: Upload
uses: appleboy/scp-action@master
with:
host: ${{ matrix.server.ip }}
username: ${{ matrix.server.username }}
key: ${{ secrets.SSH_KEY }}
port: ${{ matrix.server.port }}
source: ${{ github.sha }}.tar.gz
overwrite: true
target: $SRV_HOME/$APP/artifacts
```
I can't seem to get it working and debug messages are obscure:
```
tar all files into /tmp/1238089582/NFthDUKQxA.tar
scp file to server.
create folder $SRV_HOME/$APP/artifacts
drone-scp error: Process exited with status 1
drone-scp rollback: remove all target tmp file
remove file NFthDUKQxA.tar
2023/01/03 15:23:57 Process exited with status 1
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the workflow shown in the issue, including the env block and the target value using $SRV_HOME/$APP. Read the action's handling of the target input and compare the generated remote folder command with the expected expanded path. Done means the documented workflow reliably creates the intended target directory or clearly reports the supported syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.