-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (70 loc) · 2.25 KB
/
tooling_mend_ruby.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
77
78
79
# This is a generic workfloww that can be used to scan
# content-and-tooling projects for vulnerabilities.
name: mend
on:
workflow_call:
inputs:
api_key:
default: ''
type: string
token:
default: ''
type: string
product_name:
default: 'DevX'
type: string
ruby_version:
description: "The target Ruby version."
required: false
default: "2.7"
type: "string"
env:
MEND_API_KEY: ${{ secrets.MEND_API_KEY != '' && secrets.MEND_API_KEY || inputs.api_key }}
MEND_TOKEN: ${{ secrets.MEND_TOKEN != '' && secrets.MEND_TOKEN || inputs.token }}
PRODUCT_NAME: ${{ inputs.PRODUCT_NAME != '' && inputs.PRODUCT_NAME || inputs.product_name }}
REQUIRE_SECRETS: MEND_API_KEY MEND_TOKEN
jobs:
mend:
runs-on: "ubuntu-latest"
continue-on-error: ${{ contains(fromJson('["puppetlabs","puppet-toy-chest"]'), github.repository_owner) != true }}
steps:
- name: "check requirements"
run: |
declare -a MISSING
for V in ${REQUIRE_SECRETS} ; do
[[ -z "${!V}" ]] && MISSING+=($V)
done
if [ ${#MISSING[@]} -gt 0 ] ; then
echo "::warning::missing required secrets: ${MISSING[@]}"
exit 1
fi
- name: "checkout"
if: success()
uses: "actions/checkout@v4"
with:
fetch-depth: 1
- name: "setup ruby"
if: success()
uses: "ruby/setup-ruby@v1"
with:
ruby-version: ${{ inputs.ruby_version }}
- name: "bundle lock"
if: success()
run: bundle lock
- uses: "actions/setup-java@v4"
if: success()
with:
distribution: "temurin"
java-version: "17"
- name: "download"
if: success()
run: curl -o wss-unified-agent.jar https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar
- name: "scan"
if: success()
run: java -jar wss-unified-agent.jar
env:
WS_APIKEY: ${{ env.MEND_API_KEY }}
WS_WSS_URL: https://saas-eu.whitesourcesoftware.com/agent
WS_USERKEY: ${{ env.MEND_TOKEN }}
WS_PRODUCTNAME: ${{ env.PRODUCT_NAME }}
WS_PROJECTNAME: ${{ github.event.repository.name }}