-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
69 lines (69 loc) · 2.23 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
name: Setup Velociraptor
description: Install Velociraptor scripts manager
author: JurassiScripts
branding:
icon: terminal
color: blue
inputs:
checkout:
description: Whether to checkout repository first
default: true
required: false
deno-version:
description: Deno version to use
default: 1.x
required: false
velociraptor-version:
description: Velociraptor version to use
default: latest
required: false
velociraptor-alias:
description: Velociraptor alias name
default: vr
required: false
outputs:
deno-is-canary:
description: Whether installed Deno version is a canary version
value: ${{ steps.deno.outputs.is-canary }}
deno-version:
description: Deno version that was installed
value: ${{ steps.deno.outputs.deno-version }}
velociraptor-version:
description: Velociraptor version that was installed
value: ${{ steps.velociraptor.outputs.velociraptor-version }}
runs:
using: composite
steps:
- name: run actions/checkout@v2
uses: actions/checkout@v2
if: ${{ inputs.checkout }}
- name: run denoland/setup-deno@v1
id: deno
uses: denoland/setup-deno@v1
if: ${{ inputs.deno-version }}
with:
deno-version: ${{ inputs.deno-version }}
- name: setup velociraptor
shell: bash
run: |
case "${{ inputs.velociraptor-version }}" in
"latest") ;; "") ;;
*) VERSION=@${{ inputs.velociraptor-version }} ;;
esac
deno install --allow-all --name ${{ inputs.velociraptor-alias }} https://deno.land/x/velociraptor$VERSION/cli.ts
echo "/home/runner/.deno/bin" >> $GITHUB_PATH
- name: add velociraptor to path (macos)
shell: bash
if: ${{ contains(runner.os, 'macos') }}
run: |
echo "/Users/runner/.deno/bin" >> $GITHUB_PATH
- name: add velociraptor to path (windows)
shell: powershell
if: ${{ contains(runner.os, 'windows') }}
run: |
echo "C:\Users\runneradmin\.deno\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: compute output velociraptor-version
id: velociraptor
shell: bash
run: |
echo "::set-output name=velociraptor-version::$(${{ inputs.velociraptor-alias }} --version)"