.github/workflows/powerplatform-resource-dispatcher.yml #54
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
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '18 5 * * MON' | |
# Trigger every monday at 05:18 | |
permissions: | |
id-token: write | |
actions: write | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
powerplatform-apis: | |
name: Power Platform API Connectors | |
env: | |
api-version: '2023-05-01' | |
environment: ~default | |
runs-on: ubuntu-latest | |
steps: | |
- id: rate-limit | |
name: Check GitHub API rate limit | |
uses: thnetii/.github/actions/gh-actions-ratelimit-check@main | |
- name: Wait until GitHub API rate limit reset | |
if: fromJson(steps.rate-limit.outputs.remaining) < 20 | |
uses: thnetii/.github/actions/gh-actions-sleep-until@main | |
with: | |
datetime: ${{ steps.rate-limit.outputs.reset }} | |
- name: Chekout ${{ github.repository }}@${{ github.ref }} | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 180 | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- id: npm-clean-install-actions | |
name: Install NPM package dependencies for Github actions | |
uses: thnetii/.github/actions/gh-actions-npm@main | |
with: | |
arguments: | | |
clean-install | |
--workspace=.github/actions/powerplatform-apis-collection-download | |
--omit=dev | |
--install-links | |
--no-audit | |
--no-fund | |
- id: msidp-workflow-auth | |
name: Authenticate GitHub Actions Workflow | |
uses: thnetii/.github/actions/ms-idp-workflow-run-auth@main | |
with: | |
tenant-id: ${{ secrets.MSIDP_TENANTID }} | |
client-id: ${{ secrets.MSIDP_CLIENTID }} | |
resource: https://service.flow.microsoft.com/ | |
- id: get-api-connectors | |
name: Get Power Platform API Connectors | |
uses: ./.github/actions/powerplatform-apis-collection-download | |
with: | |
access-token: ${{ steps.msidp-workflow-auth.outputs.access-token }} | |
api-version: ${{ env.api-version }} | |
environment: ${{ env.environment }} | |
- id: process-apis-dispatch | |
name: Dispatch Power Platform API Connectors | |
uses: ./.github/actions/powerplatform-apis-collection-dispatcher | |
with: | |
api-endpoint: ${{ steps.get-api-connectors.outputs.api-endpoint }} | |
environment: ${{ steps.get-api-connectors.outputs.environment }} | |
api-connector-names: ${{ steps.get-api-connectors.outputs.api-connector-names }} | |
api-version: ${{ env.api-version }} |