.github/workflows/sharepoint-online.yml #1687
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: {} | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- csdl | |
- powerplatform | |
schedule: | |
- cron: '48 6 * * *' | |
# Trigger every day at 06:48 | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
odata_csdl: | |
name: Download SharePoint OData CSDL | |
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 | |
- name: Git configure comitter identity | |
uses: thnetii/.github/actions/git-user-config@main | |
- id: checkout-pr-branch | |
name: Swich to new branch for possible PR | |
uses: thnetii/.github/actions/create-rebase-pr-branch@main | |
with: | |
branch-name: csdl-fetcher/sharepoint | |
- 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-spo-odata-csdl-download | |
--workspace=@thnetii/microsoft-odata-csdl-github-actions-spo-onedrive-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.SHAREPOINT_RESOURCEURL }} | |
auth-method: 'az-acs-temporary-secret' | |
- id: download-csdl-odata-v4_0 | |
name: Download SharePoint CSDL in XML Format | |
uses: ./.github/actions/spo-odata-csdl-download | |
with: | |
access-token: ${{ steps.msidp-workflow-auth.outputs.access-token }} | |
sharepoint-web-url: ${{ secrets.SHAREPOINT_WEBURL }} | |
file-path: csdl/sharepoint-odata-v4_0.csdl.xml | |
- id: download-csdl-onedrive-v2_0-v4_01 | |
name: Download OneDrive v2.0 CSDL in XML Format | |
uses: ./.github/actions/spo-onedrive-csdl-download | |
with: | |
access-token: ${{ steps.msidp-workflow-auth.outputs.access-token }} | |
sharepoint-web-url: ${{ secrets.SHAREPOINT_WEBURL }} | |
file-path: csdl/sharepoint-v2.0-odata-v4_01.csdl.xml | |
api-version: v2.0 | |
- id: download-csdl-onedrive-v2_1-v4_01 | |
name: Download OneDrive v2.1 CSDL in XML Format | |
uses: ./.github/actions/spo-onedrive-csdl-download | |
with: | |
access-token: ${{ steps.msidp-workflow-auth.outputs.access-token }} | |
sharepoint-web-url: ${{ secrets.SHAREPOINT_WEBURL }} | |
file-path: csdl/sharepoint-v2.1-odata-v4_01.csdl.xml | |
api-version: v2.1 | |
- id: commit-push | |
name: Commit and push PR-branch (if any changes) | |
uses: ./.github/actions/commit-push | |
with: | |
branch-name: csdl-fetcher/sharepoint | |
commit-message: > | |
SharePoint OData CSDL, | |
Microsoft SharePoint Team Services | |
version ${{ steps.download-csdl-odata-v4_0.outputs.sharepoint-version }} | |
- id: create-pr | |
if: fromJSON(steps.commit-push.outputs.committed) | |
name: Create/update PR | |
uses: ./.github/actions/updatecreate-pr | |
with: | |
branch-name: csdl-fetcher/sharepoint | |
pr-title: Update SharePoint OData CSDL | |
pr-body: | | |
Automatic download of SharePoint API OData CSDL. | |
Microsoft SharePoint Team Services: `${{ steps.download-csdl-odata-v4_0.outputs.sharepoint-version }}` | |
Includes: | |
- SharePoint OData API for OData-Version 4.0 clients | |
- SharePoint v2.0 OData API for OData-Version 4.01 clients | |
- SharePoint v2.1 OData API for OData-Version 4.01 clients | |
- name: Add Labels to Pull Request | |
if: steps.create-pr.outputs.pr-number | |
uses: ./.github/actions/add-labels-pr | |
with: | |
pr-number: ${{ steps.create-pr.outputs.pr-number }} | |
labels: | | |
csdl-update | |
sharepoint | |
odata-v4 |