-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
51 lines (42 loc) · 1.42 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
name: nctl-scan-installer
description: Installs nctl scan
author: go-nctl
branding:
icon: package
color: blue
inputs:
release:
description: NCTL scan release version to be installed
required: false
default: 4.3.1
runs:
using: composite
steps:
- name: Download and Install nctl
shell: bash
run: |
#!/bin/bash
shopt -s expand_aliases
if [ -z "$NO_COLOR" ]; then
alias log_info="echo -e \"\033[1;32mINFO\033[0m:\""
alias log_error="echo -e \"\033[1;31mERROR\033[0m:\""
else
alias log_info="echo \"INFO:\""
alias log_error="echo \"ERROR:\""
fi
set -e
# Determine the download URL based on the release version
download_url="https://nirmata-downloads.s3.us-east-2.amazonaws.com/nctl/nctl_${{ inputs.release }}/nctl_${{ inputs.release }}_linux_386.zip"
log_info "Downloading nctl version '${{ inputs.release }}' from ${download_url}"
curl -L -o nctl.zip $download_url
log_info "Unzipping nctl..."
unzip -o nctl.zip
log_info "Making nctl executable..."
chmod u+x nctl
log_info "Moving nctl to /usr/local/bin (requires sudo)..."
sudo mv nctl /usr/local/bin/nctl
log_info "Installation complete!"
- name: Add nctl to PATH (Linux Only)
shell: bash
if: ${{ runner.os == 'Linux' }}
run: echo "/usr/local/bin" >> $GITHUB_PATH