-
Notifications
You must be signed in to change notification settings - Fork 15
/
action.yml
63 lines (51 loc) · 1.78 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
name: "ghas-policy-as-code"
description: "Advance Security Policy as Code"
inputs:
severity:
description: "Severity Level"
default: error
repository:
description: Repository owner and repo name
default: ${{ github.repository }}
token:
description: GitHub Personal Access Token
default: ${{ github.token }}
policy-repo-token:
description: Separate GitHub PAT if the policy files are stored in a separate repository
ref:
description: GitHub Ref
default: ${{ github.ref }}
action:
description: "Action to take upon discovery of security issues hitting threshold"
default: break
policy:
description: Policy as Code repository owner/repo name
policy-path:
description: Policy as Code file path (including path in repo)
policy-branch:
description: Policy as Code branch
default: main
retries:
description: Number of times to retry the action
default: 240 # 1 hours worth of retries
argvs:
description: "Additional Arguments"
runs:
using: "composite"
steps:
- shell: bash
run: |
echo "Running Policy as Code..."
export PYTHONPATH=${{ github.action_path }}:${{ github.action_path }}/vendor
python3 -m ghascompliance \
--severity "${{ inputs.severity }}" \
--action "${{ inputs.action }}" \
--github-token "${{ inputs.token }}" \
--policy-repo-token "${{ inputs.policy-repo-token }}" \
--github-repository "${{ inputs.repository }}" \
--github-ref "${{ inputs.ref }}" \
--github-policy "${{ inputs.policy }}" \
--github-policy-path "${{ inputs.policy-path }}" \
--github-policy-branch "${{ inputs.policy-branch }}" \
--retry-count "${{ inputs.retries }}" \
${{ inputs.argvs }}