Skip to content

Merge to main #2882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 142 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
f12d0d3
Weekly OpenApiDocs Download.
Apr 26, 2024
fdfa385
Add generated MgCommandMetadata.json. [run ci]
Apr 26, 2024
1b7c9b4
Updated pester tests
timayabi2020 Apr 27, 2024
1208f3f
Merge pull request #2708 from microsoftgraph/WeeklyApiRefresh/2024042…
timayabi2020 Apr 29, 2024
6cf9495
Weekly OpenApiDocs Download.
Apr 30, 2024
ded0231
Add generated MgCommandMetadata.json. [run ci]
Apr 30, 2024
75165fb
Updating examples
May 3, 2024
c6fa02c
Merge pull request #2716 from microsoftgraph/WeeklyExamplesUpdate/202…
timayabi2020 May 3, 2024
3cf1215
Adds breaking changes in response to the cmdlets that changed as a re…
timayabi2020 May 3, 2024
8cedcf7
Merge pull request #2718 from microsoftgraph/breaking-changes-communi…
timayabi2020 May 3, 2024
b1bd88b
Added migration script
timayabi2020 May 3, 2024
fdb434c
Merge pull request #2719 from microsoftgraph/add-mgrationscript
timayabi2020 May 3, 2024
3a76f80
Made changes to accomodate backward compatibility due to breaking cha…
timayabi2020 May 6, 2024
adb8130
Cleaned read me file in Applications v1.0
timayabi2020 May 6, 2024
4fb9c6d
Removed command alias from interface due to failing auth tests
timayabi2020 May 7, 2024
f229026
Merge branch 'dev' into WeeklyApiRefresh/202404301206
timayabi2020 May 7, 2024
7f3db02
Added API reference link to interface
timayabi2020 May 7, 2024
1e82dee
Merge pull request #2714 from microsoftgraph/WeeklyApiRefresh/2024043…
timayabi2020 May 7, 2024
2ea0bc1
Merge branch 'dev' of https://github.com/microsoftgraph/msgraph-sdk-p…
timayabi2020 May 7, 2024
a9c3a93
Added initial files that will be used to detect differences especiall…
timayabi2020 May 7, 2024
b52e218
Add generated MgCommandMetadata.json. [run ci]
May 7, 2024
e28b206
Merge pull request #2725 from microsoftgraph/WeeklyApiRefresh/2024050…
timayabi2020 May 7, 2024
146cab4
Added implementation for detecting open Api changes
timayabi2020 May 7, 2024
5cc0943
Updated script and pipeline
timayabi2020 May 7, 2024
ec92512
Added check for open api errors as part of prechecks in pipeline
timayabi2020 May 7, 2024
ae6dbf9
Running test with one module first
timayabi2020 May 7, 2024
08b5dcc
Moved openApiInfo to docs folder
timayabi2020 May 8, 2024
9d71ea3
Corrected paths
timayabi2020 May 8, 2024
096d8d6
Rectified file formatting
timayabi2020 May 8, 2024
2e0fb03
Added pester tests
timayabi2020 May 8, 2024
8944093
Updated metadata json file to remove commandAlias with RHV
timayabi2020 May 8, 2024
1b35d50
Added mising aliasing
timayabi2020 May 8, 2024
8857f33
Updated alias for Remove-MgBetaOnPremisePublishingProfileAgentGroupPu…
timayabi2020 May 8, 2024
1732302
Changed the build logic
timayabi2020 May 8, 2024
8344609
Added method check
timayabi2020 May 8, 2024
d8e8b4c
Updated for loop for detcting changes
timayabi2020 May 8, 2024
9d95269
Fixed formatting
timayabi2020 May 8, 2024
febc112
Removed unnecessary file
timayabi2020 May 8, 2024
29272d4
Commented out beta to flag v1.0 changes
timayabi2020 May 8, 2024
17b7733
Reenabled other modules
timayabi2020 May 8, 2024
307cb88
Updated metadata json file and metadata generation file to check for …
timayabi2020 May 8, 2024
34f0d7d
Adds test workflow
timayabi2020 May 9, 2024
e418c3e
Added workflow for metadata changes
timayabi2020 May 9, 2024
6696333
Merge pull request #2721 from microsoftgraph/backward-compatilibility…
timayabi2020 May 9, 2024
8aadcb4
Merge branch 'dev' into metadata-changes-detection
Ndiritu May 9, 2024
b5f0d8d
Merge pull request #2726 from microsoftgraph/metadata-changes-detection
timayabi2020 May 11, 2024
b7a2f7d
- updates code of conduct to the latest standard
baywet May 14, 2024
f06dcb1
Merge pull request #2740 from microsoftgraph/feature/code-of-conduct
baywet May 14, 2024
5bcd40d
Changed url location
timayabi2020 May 16, 2024
59d7e37
Merge pull request #2746 from microsoftgraph/metadata-entryfile
Ndiritu May 20, 2024
ae046fe
update author feedback label (#2750)
fey101 May 22, 2024
2138ec9
Reduce metadata changes workflow runs by triggering only when importa…
Ndiritu Jun 3, 2024
b317b3d
Grant workflow pull request write permissions and fail job to block m…
Ndiritu Jun 3, 2024
d018eb7
Merge pull request #2773 from microsoftgraph/fix/metadata-changes-per…
Ndiritu Jun 4, 2024
d7f8985
Update language and project on issues and PRs (#2776)
fey101 Jun 6, 2024
6517ed7
Remove outdated auto-add-project workflow file
fey101 Jun 6, 2024
9242e43
Merge pull request #2779 from microsoftgraph/update-language-on-issues
fey101 Jun 6, 2024
dc16548
Bump Azure.Identity in /src/Authentication/Authentication.Core
dependabot[bot] Jun 11, 2024
241618f
Merge pull request #2787 from microsoftgraph/dependabot/nuget/src/Aut…
andrueastman Jun 13, 2024
42b7dd3
Fix bug in check for command alias value
Ndiritu Jun 12, 2024
dea4dbe
chore!: replaces project bot token task by official one
baywet Jun 19, 2024
cb3ec5f
Merge pull request #2802 from microsoftgraph/feature/project-bot-offi…
baywet Jun 19, 2024
f65c1b6
remove label waiting for author feedback if issue closes (#2806)
fey101 Jun 21, 2024
aa40536
Disable blank issue template (#2812)
fey101 Jun 25, 2024
e11e9df
Merge branch 'dev' into fix/command-metadata-alias
Ndiritu Jun 25, 2024
c8e4046
Weekly OpenApiDocs Download.
Jun 25, 2024
0917575
Merge pull request #2788 from microsoftgraph/fix/command-metadata-alias
timayabi2020 Jun 26, 2024
13dd507
Rolled back devicemanagement to the one that 2.19.0 had.
timayabi2020 Jun 26, 2024
35e56f9
Ommitted Grant-MgBetaShareListItemPermission from generation due to i…
timayabi2020 Jun 26, 2024
0eedce8
Omitted New-MgBetaUserTodoListTaskLinkedResource from generation
timayabi2020 Jun 27, 2024
49f460c
Omitted Remove-MgShareListItemPermissionGrant from generation
timayabi2020 Jun 27, 2024
064eeb8
Rolled back the whole files module
timayabi2020 Jun 28, 2024
c167923
Update NewMetadatajson ps1 file
timayabi2020 Jun 29, 2024
38baf83
Rolled back DeviceManagement.Actions file
timayabi2020 Jul 1, 2024
8f35d84
Rolled back Identity.DirectoryManagement file due to failing tests
timayabi2020 Jul 2, 2024
f528616
Rolled back Applications, Identity.SignIns, Mail, PersonalContacts an…
timayabi2020 Jul 3, 2024
b6a50df
Weekly OpenApiDocs Download.
Jul 3, 2024
e68f15c
Add generated MgCommandMetadata.json. [run ci]
Jul 4, 2024
f44f40f
Updated failing pester test
timayabi2020 Jul 4, 2024
73be0e3
Merge branch 'dev' into WeeklyApiRefresh/202407031838
timayabi2020 Jul 4, 2024
c1823e1
Rolled back pester test
timayabi2020 Jul 4, 2024
5384c10
Merge pull request #2824 from microsoftgraph/WeeklyApiRefresh/2024070…
timayabi2020 Jul 4, 2024
2d910e3
Updated examples import script to get cmdlet information from MgComma…
timayabi2020 Jul 5, 2024
5f655aa
Added test path to validate json file path
timayabi2020 Jul 8, 2024
1b6e688
Fixed typo
timayabi2020 Jul 8, 2024
9b9ecf4
Added try catch
timayabi2020 Jul 8, 2024
11d9339
Updating examples
Jul 8, 2024
005aefc
Merge branch 'dev' into WeeklyExamplesUpdate/202407080606
timayabi2020 Jul 8, 2024
4425fb9
Merge pull request #2831 from microsoftgraph/WeeklyExamplesUpdate/202…
timayabi2020 Jul 8, 2024
c630f02
Updates dependabot
timayabi2020 Jul 8, 2024
90b6c09
Updated Moq
timayabi2020 Jul 8, 2024
5c58dda
Fixed wrong file example file path. Added Reset-MgUserAuthenticationM…
timayabi2020 Jul 9, 2024
154bd93
Updates Microsoft.Graph.Core to 3.1.13 and Microsoft.PowerShell.SDK t…
timayabi2020 Jul 9, 2024
03f851c
Updating examples
Jul 9, 2024
928e1f6
Merge pull request #2839 from microsoftgraph/WeeklyExamplesUpdate/202…
timayabi2020 Jul 9, 2024
7335478
Merge branch 'dev' into update-dependabot-for-Moq
timayabi2020 Jul 9, 2024
8ceb1db
Merge pull request #2835 from microsoftgraph/update-dependabot-for-Moq
timayabi2020 Jul 10, 2024
b227a58
Removes invalid files, causing credscan issues
timayabi2020 Jul 10, 2024
dc7d419
Added Reset-MgBetaUserAuthenticationMethodPassword.md to credscan sup…
timayabi2020 Jul 10, 2024
071e07b
Deleted invalid example file
timayabi2020 Jul 10, 2024
815b63f
Resets to original graph environment only if the current environment …
timayabi2020 Jul 10, 2024
8ec4f11
Fixed FetchStream in a try-catch block
timayabi2020 Jul 10, 2024
28c90e0
Formatted script
Jul 10, 2024
2983d8f
Adds logs
Jul 10, 2024
d15f32d
Added Start-Generator function to a try-catch block
Jul 10, 2024
babba66
Added help message to parameters
Jul 10, 2024
252c633
Updating examples
Jul 10, 2024
63beaae
Adds missing descriptions during cmdlet generation
Jul 11, 2024
44c584f
Updated maml and md files
Jul 11, 2024
c239398
Rolled back script to fix failing test
Jul 11, 2024
9ff2b42
Merge pull request #2842 from microsoftgraph/2795-when-using-in-azure…
timayabi2020 Jul 12, 2024
1c93b76
Merge branch 'dev' into WeeklyExamplesUpdate/202407102119
timayabi2020 Jul 12, 2024
7ad8c6d
Merge pull request #2844 from microsoftgraph/WeeklyExamplesUpdate/202…
timayabi2020 Jul 12, 2024
9da4e46
Merge branch 'dev' into 2781-what-happened-to-the-parameters-descript…
timayabi2020 Jul 12, 2024
bf52377
Merge pull request #2845 from microsoftgraph/2781-what-happened-to-th…
timayabi2020 Jul 12, 2024
f0278a8
Updating examples
Jul 19, 2024
9c7d6b5
Rectified examples on Update-MgBetaRoleManagementCloudPcRoleDefinitio…
Jul 19, 2024
efcd5a5
Merge pull request #2854 from microsoftgraph/WeeklyExamplesUpdate/202…
timayabi2020 Jul 22, 2024
5eb1e94
Remove invalid paths that exceed Windows file name limit
Jul 22, 2024
e0719b6
Added directive to remove invalid Revoke-MgBetaShareListItemPermissio…
Jul 23, 2024
02242be
Weekly OpenApiDocs Download.
Jul 24, 2024
3de4c3d
Add generated MgCommandMetadata.json. [run ci]
Jul 24, 2024
f0c0b11
Rolled back Applications, PersonalContacts, Identity.SingIns, Mail an…
Jul 25, 2024
b8d643e
Update Set-MgUserPhotoContent.md
Agazoth Jul 25, 2024
62be29f
Rolled back metadatacommand json file due to missing cmdlets
Jul 25, 2024
f95f2fe
Weekly OpenApiDocs Download.
Jul 25, 2024
5eb6389
Add generated MgCommandMetadata.json. [run ci]
Jul 25, 2024
dde0281
Merge pull request #2864 from microsoftgraph/WeeklyApiRefresh/2024072…
timayabi2020 Jul 25, 2024
140374c
Merge pull request #2863 from Agazoth/patch-1
timayabi2020 Jul 25, 2024
0182a65
Merge branch 'dev' into WeeklyApiRefresh/202407240727
timayabi2020 Jul 25, 2024
f7dae28
Merge pull request #2862 from microsoftgraph/WeeklyApiRefresh/2024072…
timayabi2020 Jul 29, 2024
de7676f
fix: adds workflow to publish docker image
baywet Jul 29, 2024
982fddd
Merge pull request #2874 from microsoftgraph/bugfix/docker-outdated
baywet Jul 29, 2024
9974960
Temporary work around for external docs url for endpoints that point …
Jul 29, 2024
4a82ba3
Formatted code
Jul 29, 2024
fdf5711
Rolled back mgCommandMetadata.json
Jul 29, 2024
6f92604
Adds directive to prevent Get-MgUserMailFolderMessageContent from be…
Jul 30, 2024
582eba0
Patch for updating docker container
Jul 30, 2024
804fd63
Merge pull request #2876 from microsoftgraph/2377-create-a-new-contai…
timayabi2020 Aug 1, 2024
e329857
Merge branch 'dev' into 2867-find-mggraphcommand-returns-incorrect-ap…
timayabi2020 Aug 1, 2024
9558be0
Merge pull request #2875 from microsoftgraph/2867-find-mggraphcommand…
timayabi2020 Aug 1, 2024
c9c6c2e
Merge branch 'main' into update-main-01-08-2024
timayabi2020 Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
git submodule update --init --recursive
- template: ./common-templates/install-tools.yml
- template: ./common-templates/security-pre-checks.yml

- template: ./generation-templates/authentication-module.yml
parameters:
Test: ${{ parameters.Test }}
Expand Down
18 changes: 18 additions & 0 deletions .azure-pipelines/common-templates/download-openapi-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ steps:
script: |
. "$(System.DefaultWorkingDirectory)\tools\Versions\BumpModuleVersion.ps1" -BumpV1Module -BumpBetaModule -BumpAuthModule -Debug

- task: PowerShell@2
name: BuildOpenApiMetadataDetectionTool
displayName: Build tool for detecting metadata changes
inputs:
pwsh: true
targetType: inline
script: dotnet build --configuration Release
workingDirectory: "$(System.DefaultWorkingDirectory)/tools/OpenApiInfoGenerator/OpenApiInfoGenerator"

- task: PowerShell@2
name: GenerateOpenApiErrorAndInfoFiles
displayName: Generate OpenApi error and info file for detecting unnecessary changes that would lead to a breaking change
inputs:
pwsh: true
targetType: inline
script: dotnet run
workingDirectory: "$(System.DefaultWorkingDirectory)/tools/OpenApiInfoGenerator/OpenApiInfoGenerator"

- task: Bash@3
displayName: Commit downloaded files
condition: and(succeeded(), ne(variables['OpenAPIDocDiff.ModulesWithChanges'], ''))
Expand Down
6 changes: 6 additions & 0 deletions .azure-pipelines/common-templates/install-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ steps:
inputs:
debugMode: false
version: 7.x

- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
debugMode: false
version: 8.x

- task: NuGetToolInstaller@1
displayName: Install Nuget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@
"file": [
"src\\Users.Actions\\beta\\examples\\Test-MgBetaUserPassword.md",
"src\\Users.Actions\\beta\\examples\\Update-MgBetaUserPassword.md",
"src\\Users.Actions\\beta\\examples\\Reset-MgBetaUserAuthenticationMethodPassword.md",
"src\\Users.Actions\\v1.0\\examples\\Update-MgUserPassword.md"
],
"_justification": "[Users.Actions] Examples contain random values recognized as secret"
},
{
"file": [
"src\\DeviceManagement.Actions\\beta\\examples\\Update-MgBetaDeviceManagementVirtualEndpointOnPremisConnectionAdDomainPassword.md"
"src\\DeviceManagement.Actions\\beta\\examples\\Update-MgBetaDeviceManagementVirtualEndpointOnPremiseConnectionAdDomainPassword.md"
],
"_justification": "[DeviceManagement.Actions] Examples contain random values recognized as secret"
},
{
"file": [
"src\\Users.Actions\\v1.0\\examples\\Reset-MgUserAuthenticationMethodPassword.md"
],
"_justification": "[Users.Actions] Examples contain random values recognized as secret"
},
{
"file": [
"tools\\Tests\\loadEnv.md"
Expand Down
10 changes: 10 additions & 0 deletions .azure-pipelines/generation-templates/check-openapi-errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
steps:
- task: PowerShell@2
displayName: Check for OpenAPI Errors
inputs:
targetType: inline
pwsh: true
script: |
. $(System.DefaultWorkingDirectory)/tools/OpenApiInfoGenerator/OpenApiInfoGenerator/OpenApiChanges.ps1
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE/03-blank-issue.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blank_issues_enabled: true
blank_issues_enabled: false
contact_links:
- name: For issues related to authentication and service errors
url: https://learn.microsoft.com/powershell/microsoftgraph/troubleshooting
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ updates:
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 1
- package-ecosystem: "nuget"
directory: "/src/Authentication/Authentication.Test"
schedule:
interval: "daily"
allow:
- dependency-name: "Moq"
open-pull-requests-limit: 1
44 changes: 27 additions & 17 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
id:
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
owner:
resource: repository
disabled: false
where:
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description:
- description:
frequencies:
- hourly:
hour: 1
filters:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
- hasLabel:
label: no-recent-activity
- noActivitySince:
Expand All @@ -25,15 +25,15 @@ configuration:
label: service bug
actions:
- closeIssue
- description:
- description:
frequencies:
- hourly:
hour: 1
filters:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
- noActivitySince:
days: 4
- isNotLabeledWith:
Expand All @@ -43,7 +43,7 @@ configuration:
label: no-recent-activity
- addReply:
reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
- description:
- description:
frequencies:
- hourly:
hour: 1
Expand All @@ -59,20 +59,30 @@ configuration:
reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
- closeIssue
eventResponderTasks:
- if:
- payloadType: Issues
- isAction:
action: Closed
- hasLabel:
label: 'status:waiting-for-author-feedback'
then:
- removeLabel:
label: 'status:waiting-for-author-feedback'
description:
- if:
- payloadType: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'Needs: Author Feedback'
label: 'status:waiting-for-author-feedback'
then:
- addLabel:
label: 'Needs: Attention :wave:'
- removeLabel:
label: 'Needs: Author Feedback'
description:
label: 'status:waiting-for-author-feedback'
description:
- if:
- payloadType: Issues
- not:
Expand All @@ -83,13 +93,13 @@ configuration:
then:
- removeLabel:
label: no-recent-activity
description:
description:
- if:
- payloadType: Issues
- labelAdded:
label: service bug
then: []
description:
description:
- if:
- payloadType: Issue_Comment
- activitySenderHasAssociation:
Expand All @@ -102,7 +112,7 @@ configuration:
isRegex: False
then:
- addLabel:
label: 'Needs: Author Feedback'
description:
onFailure:
onSuccess:
label: 'status:waiting-for-author-feedback'
description:
onFailure:
onSuccess:
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Docker image
on:
workflow_dispatch:
push:
tags: ["*"]
env:
REGISTRY: msgraphprod.azurecr.io
IMAGE_NAME: public/microsoftgraph/powershell
jobs:
push_to_registry:
environment:
name: acr
name: Push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to GitHub package feed
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
registry: ${{ env.REGISTRY }}

- name: Get truncated run number
id: getversion
run: |
$version = $Env:GITHUB_REF.replace("refs/tags/", "")
Write-Output "version=$version" >> $Env:GITHUB_OUTPUT
shell: pwsh
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Push to GitHub Packages - Release
uses: docker/build-push-action@v6.5.0
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}
build-args: |
VERSION=${{ steps.getversion.outputs.version }}
68 changes: 68 additions & 0 deletions .github/workflows/metadatachanges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This is a basic workflow to help you get started with Actions

name: "Metadata Changes"
on:
workflow_dispatch:
pull_request:
branches:
- dev
paths:
- openApiDocs/**
- src/Authentication/Authentication/custom/common/MgCommandMetadata.json
- docs/OpenApiInfo/**

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
CheckForMetadataChanges:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.action != 'closed')
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}


# Check if error report exists
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "docs/OpenApiInfo/v1.0/openAPIErrors.csv"

# If it exists then add a warning to comment section of the PR
- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
uses: actions/github-script@v7
with:
script: |
const name = 'OpenApiChecks';
const body = '**Changes in metadata detected :bangbang:** :warning:\n Please have a look at the metadata changes report in `docs/OpenApiInfo/v1.0/openAPIErrors.csv`\nThis action is important before merging :pleading_face:';

await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})

await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
body: body,
pull_number: context.issue.number,
event: 'REQUEST_CHANGES'
})

core.setFailed(body)

# [0] https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
# [1] https://hub.github.com/hub-pull-request.1.html
# https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
Loading