Rust Filter and Push #3139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust Filter and Push | |
on: | |
schedule: | |
- cron: '0 */4 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Build | |
run: cargo build --release | |
- name: Run | |
run: cargo run | |
- name: Calculate Domain Changes | |
run: echo "DOMAIN_CHANGES=$(git diff --shortstat phishing-sites-list.json | awk '{print $4}')" >> $GITHUB_ENV | |
- name: Commit and Push | |
run: | | |
if [[ $DOMAIN_CHANGES -gt 5 ]]; then | |
git config --local user.email "[email protected]" | |
git config --local user.name "codeesura" | |
git add . | |
git commit -m "Add-remove filtered domains" || echo "No changes to commit" | |
git push | |
fi |