-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
41 lines (38 loc) · 1.31 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
41
name: Archive Action
author: ihiroky
branding:
icon: archive
color: blue
description: Create a various format archive file for your artifacts, and works on any platform.
inputs:
root_dir:
description: Root directory.
required: true
base_dir:
description: Base directory; common prefix of all files and directories in the archive, relative to root_dir.
required: false
default: .
file_path:
description: 'Output file path. Supported extensions: zip, tar, tar.gz(tgz), tar.bz2(tbz2), tar.xz(txz)'
required: false
default: output.zip
verbose:
description: 'Shows details about the result of running this action.'
required: false
default: false
runs:
using: 'composite'
steps:
- run: |
import os
# Environment variables for 'inputs' are probably not defined in python shell.
# So refer them here.
file_path = '${{ inputs.file_path }}'
root_dir = '${{ inputs.root_dir }}'
base_dir = '${{ inputs.base_dir }}'
verbose = '${{ inputs.verbose }}'
if verbose.lower() == 'true':
print('Working directory: {}'.format(os.getcwd()))
script = os.path.join(r'${{ github.action_path }}', 'compress.py')
os.system(r'python3 "{}" "{}" "{}" "{}" "{}"'.format(script, file_path, root_dir, base_dir, verbose))
shell: python