-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
122 lines (105 loc) · 3.27 KB
/
Copy pathaction.yml
File metadata and controls
122 lines (105 loc) · 3.27 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: 'PII Scanner'
description: 'Scan code for PII and sensitive information using AWS Comprehend'
author: 'Ventz Petkov'
inputs:
scan-all:
description: 'Scan all files recursively instead of just changed files'
required: false
default: 'false'
min-confidence:
description: 'Minimum confidence score (0.0-1.0) for PII detection'
required: false
default: '0.85'
output-format:
description: 'Output format: text, json, or csv'
required: false
default: 'text'
custom-regex-file:
description: 'Path to file containing custom regex patterns'
required: false
exclude-dirs:
description: 'Comma-separated list of directories to exclude'
required: false
exclude-exts:
description: 'Comma-separated list of file extensions to exclude'
required: false
workers:
description: 'Number of worker threads'
required: false
default: '8'
verbose:
description: 'Enable verbose output'
required: false
default: 'false'
quiet:
description: 'Suppress all output except findings and errors'
required: false
default: 'false'
aws-region:
description: 'AWS region to use for Comprehend API'
required: false
default: 'us-east-1'
config-file:
description: 'Path to configuration file'
required: false
runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install AWS CLI and Boto3
shell: bash
run: |
pip install awscli boto3
- name: Run PII Scan
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ inputs.aws-region }}
run: |
# Build command with inputs
CMD="python ${{ github.action_path }}/pii-engine/pii_scan"
# Add optional arguments based on inputs
if [ "${{ inputs.scan-all }}" == "true" ]; then
CMD="$CMD --all"
fi
if [ -n "${{ inputs.min-confidence }}" ]; then
CMD="$CMD --min-confidence ${{ inputs.min-confidence }}"
fi
if [ -n "${{ inputs.output-format }}" ]; then
CMD="$CMD --output ${{ inputs.output-format }}"
fi
if [ -n "${{ inputs.custom-regex-file }}" ]; then
CMD="$CMD --custom-regex ${{ inputs.custom-regex-file }}"
fi
if [ -n "${{ inputs.exclude-dirs }}" ]; then
CMD="$CMD --exclude-dirs \"${{ inputs.exclude-dirs }}\""
fi
if [ -n "${{ inputs.exclude-exts }}" ]; then
CMD="$CMD --exclude-exts \"${{ inputs.exclude-exts }}\""
fi
if [ -n "${{ inputs.workers }}" ]; then
CMD="$CMD --workers ${{ inputs.workers }}"
fi
if [ "${{ inputs.verbose }}" == "true" ]; then
CMD="$CMD --verbose"
fi
if [ "${{ inputs.quiet }}" == "true" ]; then
CMD="$CMD --quiet"
fi
if [ -n "${{ inputs.config-file }}" ]; then
CMD="$CMD --config ${{ inputs.config-file }}"
fi
# Execute the command
echo "Running: $CMD"
eval $CMD
branding:
icon: 'shield'
color: 'red'