Skip to content

Update Phishing Detection Datasets #21

Update Phishing Detection Datasets

Update Phishing Detection Datasets #21

name: Update Phishing Detection Datasets
on:
schedule:
- cron: '0 0 * * 0' # Midnight UTC every Sunday
jobs:
update_data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: duckduckgo/macos-browser
path: macos/
token: ${{ secrets.DAX_MACOS_BROWSER_PHISHING_AUTOMATION }}
- name: Execute Update Script
run: |
cd ./macos
REVISION="$(bash ./scripts/update_phishing_detection_data.sh | grep -oP 'Updated revision from \K\d+')"
echo "REVISION=$REVISION" >> $GITHUB_ENV
TEMPLATE="$(bash ./scripts/update_phishing_detection_data.sh pr-body)"
PR_BODY_MACOS="${TEMPLATE//\{\{revision\}\}/$REVISION}"
echo "PR_BODY_MACOS<<EOF" >> $GITHUB_ENV
echo "$PR_BODY_MACOS" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create PR for macOS
uses: peter-evans/create-pull-request@88bf0de51c7487d91e1abbb4899332e602c58bbf
id: create-pr
with:
path: macos/
add-paths: |
./DuckDuckGo/PhishingDetection/
commit-message: Update phishing detection data to revision ${{ env.REVISION }}
branch: update-phishing-protection-${{ env.REVISION }}
title: Update phishing protection datasets to ${{ env.REVISION }}
body: "${{ env.PR_BODY_MACOS }}"