Skip to content

Commit

Permalink
Add security test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltroger committed Mar 26, 2024
1 parent 98bf924 commit e2adbce
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/security_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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://http-observatory.security.mozilla.org/api/v1/analyze?host=michaeltroger.com' > temp_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

0 comments on commit e2adbce

Please sign in to comment.