File tree 2 files changed +44
-0
lines changed
2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Validate only supported API version changes
2
+ on :
3
+ pull_request :
4
+ branches : ' **'
5
+ paths :
6
+ - rest/v6/**/*
7
+ - rest/v8/**/*
8
+ jobs :
9
+ validate :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout Project
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Use Node.js v18
16
+ uses : actions/setup-node@v3
17
+ with :
18
+ node-version : 18
19
+
20
+ - name : Install dependencies
21
+ run : npm ci
22
+
23
+ - name : Request changes
24
+ run : node ./scripts/actions/unsupported-api-version-changes.mjs
25
+ env :
26
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ import { readFile } from 'node:fs/promises' ;
2
+ import process from "node:process" ;
3
+ import { Octokit } from '@octokit/action' ;
4
+
5
+ const octokit = new Octokit ( ) ;
6
+ const [ OWNER , REPOSITORY ] = process . env . GITHUB_REPOSITORY . split ( '/' ) ;
7
+
8
+ /** @type {import('@octokit/webhooks-types').PullRequestOpenedEvent | import('@octokit/webhooks-types').PullRequestSynchronizeEvent } */
9
+ const prEvent = JSON . parse ( await readFile ( process . env . GITHUB_EVENT_PATH , 'utf8' ) ) ;
10
+ const { pull_request : { number } } = prEvent ;
11
+
12
+ await octokit . pulls . createReview ( {
13
+ event : "REQUEST_CHANGES" ,
14
+ body : "Please only update supported API versions." ,
15
+ owner : OWNER ,
16
+ repo : REPOSITORY ,
17
+ pull_number : number ,
18
+ } ) ;
You can’t perform that action at this time.
0 commit comments