-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
57 lines (51 loc) · 1.33 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
name: 'Wordfence Malware Scan'
inputs:
license:
required: true
version:
default: main
path:
default: .
required: false
workers:
default: 4
args:
default: ''
required: false
outputs:
result:
description: "Scan result"
value: ${{ steps.result.outputs.RESULT }}
runs:
using: 'composite'
steps:
- name: Install wordfence
shell: bash
run: |
git clone -b ${{ inputs.version }} https://github.com/wordfence/wordfence-cli.git /tmp/wordfence-cli
docker build -t wordfence-cli:${{ inputs.version }} /tmp/wordfence-cli/
- name: Run wordfence
shell: bash
run: |
docker run -v ${{ inputs.path }}:/var/www wordfence-cli:${{ inputs.version }} malware-scan \
--no-cache \
--no-banner \
--no-color \
--license=${{ inputs.license }} \
--workers=${{ inputs.workers }} \
--include-all-files \
${{ inputs.args }} \
/var/www/ > /tmp/wordfence-result
- name: Output result
id: result
shell: bash
run: |
cat /tmp/wordfence-result
{
echo 'RESULT<<EOF'
cat /tmp/wordfence-result
echo -e "\n"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
[ -s /tmp/wordfence-result ] && exit 1
rm /tmp/wordfence-result