Update ServiceTags_Public.json #1873
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: Update ServiceTags_Public.json | |
# Run on schedule | |
on: | |
schedule: | |
- cron: '00 3 * * *' | |
workflow_dispatch: | |
# Jobs | |
jobs: | |
update: | |
name: Update | |
runs-on: ubuntu-latest | |
# Steps | |
steps: | |
# Inspect Github context | |
- name: Inspect Github context | |
run: | | |
echo "The github context is:" | |
echo "${{ toJson(github) }}" | |
# 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 --connect-timeout 60 --retry 3 --retry-delay 15 --show-error --compressed -v -o ./ServiceTags_Public.json ${{ env.SOURCE }} | |
# Set commit vars | |
- name: Set commit vars | |
run: | | |
echo "COMMIT_MESSAGE=Robot updated $(date +%c)" >> $GITHUB_ENV | |
# Commit and Push | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_user_name: jensihnow | |
commit_user_email: [email protected] | |
commit_message: ${{ env.COMMIT_MESSAGE }} |