Check for Definition Updates #19641
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: Check for Definition Updates | |
on: | |
workflow_dispatch: | |
schedule: | |
# do not schedule to the full hour to be friendly to github runners | |
- cron: "17 5 * * *" | |
permissions: | |
id-token: write | |
contents: write | |
env: | |
TWEET_PATH: out | |
AZURE_CORE_COLLECT_TELEMETRY: 'false' | |
jobs: | |
update: | |
strategy: | |
# git commit/push operations of different categories could | |
# interfere with each other, so execute them sequentially | |
max-parallel: 1 | |
fail-fast: true | |
matrix: | |
include: | |
- type: Azure Role Definitions | |
script: fetch-azure-roles.sh | |
dir: azure-roles | |
- type: Azure Provider Operation Definitions | |
script: fetch-azure-operations.sh | |
dir: azure-provider-operations | |
name: Update ${{ matrix.type }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Azure login | |
uses: Azure/[email protected] | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Update to most recent HEAD | |
run: git pull -r | |
- name: Fetch current ${{ matrix.type }} | |
run: ./scripts/${{ matrix.script }} "${{ matrix.dir }}" | |
- name: Check for differences | |
run: ./scripts/process-changes.sh "${{ matrix.dir }}" | |
- name: Upload Tweets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tweets-${{ matrix.type }} | |
path: ${{ env.TWEET_PATH }}/ | |
if-no-files-found: ignore | |
create-tweet-matrix: | |
runs-on: ubuntu-22.04 | |
needs: update | |
steps: | |
- name: Download Tweets | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.TWEET_PATH }}/ | |
- name: Create Matrix | |
id: create-matrix | |
run: | | |
TWEETS="$(cat "${TWEET_PATH}"/*/*.tweet | jq --slurp -c .)" | |
echo "tweets=${TWEETS}" > "${GITHUB_OUTPUT}" | |
echo "${TWEETS}" | jq > "${GITHUB_STEP_SUMMARY}" | |
outputs: | |
tweets: ${{ steps.create-matrix.outputs.tweets }} | |
tweet: | |
runs-on: ubuntu-22.04 | |
needs: create-tweet-matrix | |
# deactivated for now, twitter account suspended | |
if: false | |
# if: ${{ needs.create-tweet-matrix.outputs.tweets != '[]' && needs.create-tweet-matrix.outputs.tweets != '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
tweet: ${{ fromJson(needs.create-tweet-matrix.outputs.tweets) }} | |
steps: | |
- uses: Eomm/why-don-t-you-tweet@v1 | |
env: | |
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} | |
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} | |
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
with: | |
tweet-message: ${{ matrix.tweet }} |