Weekly workflow to download all Feeds related to MSFT Public IP Ranges #144
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: Weekly workflow to download all Feeds related to MSFT Public IP Ranges | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1 * * */4" # Runs at 02:00 AM (UTC) every 4th day-of-week (Check https://crontab.tech/) | |
jobs: | |
download-mitreattackmap: | |
name: Weekly workflow to download all Feeds related to MSFT Public IP Ranges | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: 🍽️ Checkout the repo | |
uses: actions/checkout@v2 | |
with: | |
path: master | |
fetch-depth: 0 | |
- name: 🐍 Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
architecture: "x64" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pandas lxml_html_clean requests_html | |
- name: 🚀 Run automation script | |
run: python master/.script/get-msftpubliip-servicetags.py | |
- name: Check if there are changes to commit | |
id: check_diff | |
run: | | |
cd master | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
cd .. | |
- name: Commit files | |
if: steps.check_diff.outputs.changed == 'true' | |
run: | | |
cd master | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add * | |
git commit -m "Adding updated MSFT IP Ranges files" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: steps.check_diff.outputs.changed == 'true' | |
with: | |
directory: "master" | |
github_token: ${{ secrets.GITHUB_TOKEN }} |