-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
40 lines (37 loc) · 1.07 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Docker Copy
description: Run steps using docker
author: tj-actions
inputs:
container:
description: 'Container name'
required: true
source:
description: 'Source file or directory'
required: true
destination:
description: 'Destination file or directory'
required: true
local:
description: 'Copy from container to local (i.e container to host)'
required: false
default: 'true'
options:
description: 'Additional options passed to [docker cp](https://docs.docker.com/engine/reference/commandline/cp/#options)'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Docker copy
shell: bash
run: |
# Run docker cp
EXTRA_ARGS=${{ inputs.options }}
if [ "${{ inputs.local }}" != "true" ]; then
docker cp $EXTRA_ARGS ${{ inputs.source }} ${{ inputs.container }}:${{ inputs.destination }}
else
docker cp $EXTRA_ARGS ${{ inputs.container }}:${{ inputs.source }} ${{ inputs.destination }}
fi
branding:
icon: refresh-cw
color: white