Skip to content

Commit

Permalink
Merge pull request #2773 from microsoftgraph/fix/metadata-changes-per…
Browse files Browse the repository at this point in the history
…missions

Fix Metadata breaking change workflow
  • Loading branch information
Ndiritu authored Jun 4, 2024
2 parents ae046fe + b317b3d commit d018eb7
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/metadatachanges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
# This is a basic workflow to help you get started with Actions

name: "Metadata Changes"
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, closed]
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:
Expand Down Expand Up @@ -50,6 +53,16 @@ jobs:
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

0 comments on commit d018eb7

Please sign in to comment.