Skip to content

.github/workflows/dynamics-365-crm.yml #777

.github/workflows/dynamics-365-crm.yml

.github/workflows/dynamics-365-crm.yml #777

on:
workflow_dispatch: {}
push:
branches:
- main
paths-ignore:
- csdl
- powerplatform
schedule:
- cron: '27 7 * * *'
# Trigger every day at 07:27
permissions:
id-token: write
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}
jobs:
odata_csdl:
name: Download Microsoft Dynamics 365 CRM OData CSDL
runs-on: ubuntu-latest
env:
branch-name: csdl-fetcher/d365-crm
d365-api-version: v9.2
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
- name: Git configure comitter identity
uses: thnetii/.github/actions/git-user-config@main
- id: checkout-pr-branch
name: Swich to new branch
uses: thnetii/.github/actions/create-rebase-pr-branch@main
with:
branch-name: ${{ env.branch-name }}
- 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=@thnetii/microsoft-odata-csdl-github-actions-dynamics-365-crm-csdl-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: ${{ secrets.DYNAMICS365CRM_INSTANCEURL }}
- id: download-csdl
name: Download Microsoft Dynamics 365 CRM CSDL in XML format
uses: ./.github/actions/dynamics-365-crm-csdl-download
with:
access-token: ${{ steps.msidp-workflow-auth.outputs.access-token }}
d365-instance-url: ${{ secrets.DYNAMICS365CRM_INSTANCEURL }}
api-version: ${{ env.d365-api-version }}
file-path: csdl/dynamics365-crm-${{ env.d365-api-version }}.csdl.xml
- id: commit
name: Commit and push (if any changes)
uses: ./.github/actions/commit-push
with:
branch-name: ${{ env.branch-name }}
commit-message: Microsoft Dynamics 365 CRM OData CSDL, v${{ steps.download-csdl.outputs.d365-version }}
- id: merge
name: Merge into ${{ github.ref || github.sha }}
if: fromJSON(steps.commit.outputs.committed)
uses: ./.github/actions/merge-branch
with:
branch-name: ${{ env.branch-name }}