-
-
Notifications
You must be signed in to change notification settings - Fork 5
30 lines (28 loc) · 1.23 KB
/
security_test.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
name: Test website safety
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # Runs every day at 2am
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check website safety
run: |
curl -d 'hidden=true' 'https://observatory-api.mdn.mozilla.net/api/v2/scan?host=michaeltroger.com' > temp_testreport.txt
rm testreport.txt
echo "Test report generated via observatory.mozilla.org API" >> testreport.txt
cat temp_testreport.txt | grep -oP '(?<="grade":")[^"]*' | sed 's/^/Grade: /' >> testreport.txt
cat temp_testreport.txt | grep -oP '(?<="score":)\d+' | sed 's/^/Score: /' >> testreport.txt
cat temp_testreport.txt | grep -oP '(?<="tests_quantity":)\d+' | sed 's/^/Total Tests: /' >> testreport.txt
cat temp_testreport.txt | grep -oP '(?<="tests_failed":)\d+' | sed 's/^/Failed Tests: /' >> testreport.txt
rm temp_testreport.txt
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
branch: feature/update_testreport
title: Update of test report
commit-message: Update of test report
add-paths: |
testreport.txt