Skip to content

Test website safety #235

Test website safety

Test website safety #235

Workflow file for this run

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