Skip to content

Update ServiceTags_Public.json #612

Update ServiceTags_Public.json

Update ServiceTags_Public.json #612

Workflow file for this run

name: Update ServiceTags_Public.json
# Run on schedule
on:
schedule:
- cron: '00 3 * * *'
workflow_dispatch:
# Jobs
jobs:
update:
name: Update
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
# Steps
steps:
# Checkout
- name: Checkout
uses: actions/checkout@main
# Extract the URL
- name: Extract the source url from (https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519)
run: |
echo "SOURCE=$( wget -U \"Github Actions\" -O - https://www.microsoft.com/en-us/download/confirmation.aspx\?id\=56519 -q | grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' | grep ServiceTags_Public_ | head -1 | sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//')" >> $GITHUB_ENV
# Download
- name: Download from source
run: curl -sL ${{ env.SOURCE }} -o ./ServiceTags_Public.json
# Set commit vars
- name: Set commit vars
run: |
echo "COMMIT_MESSAGE=Github Action updated $(date +%c)" >> $GITHUB_ENV
# Commit and Push
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: WA SOC
commit_user_email: cybersecurity@dpc.wa.gov.au
commit_message: ${{ env.COMMIT_MESSAGE }}