-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
76 lines (69 loc) · 2.13 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: 'Scribe installer'
description: 'Scribe tool installer'
author: Mikey Strauss
inputs:
tools:
description: 'Select scribe tools <tool:version>'
required: false
default: 'gensbom,valint'
runs:
using: "composite"
steps:
- name: Installing tool
run: |
#!/bin/bash
function install_APT() {
TOOLS=$1
echo "Installing using APT" ${TOOLS}
PLATFORM_SCRIPT="$GITHUB_ACTION_PATH/scripts/$RUNNER_OS.sh"
if [ ! -e "$PLATFORM_SCRIPT" ]
then
echo "$RUNNER_OS OS not supported by installer"
exit 1
fi
. "$PLATFORM_SCRIPT" ${TOOLS}
}
TOOLS=${{ inputs.tools }}
export SCRIBE_TOOLS=${TOOLS//,/ }
if [[ "${TOOLS}" == "fs-tracker" ]]; then
install_APT ${TOOLS}
else
echo "Installing using install script" ${{ inputs.version }} ${{ inputs.tool }}
export SCRIBE_DEBUG=${DEBUG}
export SCRIBE_INSTALL_DIR=/usr/local/bin
curl -sSfL https://raw.githubusercontent.com/scribe-security/misc/master/install.sh | sh
if [ $? -eq 0 ] ; then
echo "Installer success"
else
echo "Installer failed"
install_APT ${TOOLS}
fi
fi
shell: bash
- name: Installing tool default config
run: |
#!/bin/bash
set -x
TOOLS=${{ inputs.tools }}
export SCRIBE_TOOLS=${TOOLS//,/ }
for tool in ${SCRIBE_TOOLS}; do
DEFAULT_CONFIG="$GITHUB_ACTION_PATH/configs/$tool/$RUNNER_OS.yaml"
ls -lhR $GITHUB_ACTION_PATH/configs/
if [ ! -e "$DEFAULT_CONFIG" ]
then
echo "$RUNNER_OS Config not supported by installer"
exit 0
fi
if [ "$(id --user)" -eq "0" ]; then
sudocmd=""
else
sudocmd="sudo"
fi
$sudocmd mkdir -p $XDG_CONFIG_HOME/$tool
$sudocmd chmod 755 $XDG_CONFIG_HOME/$tool
$sudocmd cp $DEFAULT_CONFIG $XDG_CONFIG_HOME/$tool/$tool.yaml
done
shell: bash
branding:
icon: shield
color: green