-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (45 loc) · 1.42 KB
/
detection_review.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
name: Automated Detection Age Review
on:
# schedule:
# - cron: 00 09 * * 1
# push:
# branches:
# - main
jobs:
detection_review:
runs-on: ${{ vars.DEFAULT_RUNS_ON }}
outputs:
reveiwlist: ${{ steps.python_output.outputs.result }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
- run: |
output=$(python ./helpers/detection_review_script_ga.py)
authors=$(echo "$output" | grep -oP "(?<=Authors: )[A-Za-z, ]+(?=;)" | tr -d '[:space:]')
detections=$(echo "$output" | grep -oP "(?<=Detections to review: )[A-Za-z0-9,\-_ ]+")
echo authors=$authors >> $GITHUB_ENV
echo detections=$detections >> $GITHUB_ENV
id: python_output
- name: Print reveiwlist
run: |
echo "$env.authors"
echo "$env.detections"
- name: Create detection review issue
if: env.detections != 'None'
uses: imjohnbo/issue-bot@v3
with:
assignees: ${{ env.authors }}
labels: "review"
title: "Review Detections"
body: |
## Detections to review
${{ env.detections }}
## Authors
${{ env.authors }}
pinned: false
close-previous: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}