Skip to content

Commit 8781faa

Browse files
committed
Merge branch 'master' into autogenerate
2 parents 5944635 + 09cd940 commit 8781faa

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: CI
33
on:
44
pull_request:
55
branches: [ master ]
6-
76
jobs:
87
build:
98
runs-on: ubuntu-latest
@@ -15,6 +14,11 @@ jobs:
1514
uses: actions/setup-node@v2.1.2
1615
with:
1716
node-version: 10.x
17+
18+
- name: GitHub context (actor and head ref)
19+
run: |
20+
echo ${{ github.actor }}
21+
echo ${{ github.head_ref }}
1822
1923
- name: Install NPM modules
2024
run: npm ci
@@ -27,7 +31,9 @@ jobs:
2731
automerge:
2832
runs-on: ubuntu-latest
2933
needs: build
30-
if: ${{ github.actor == 'AzureSDKAutomation' && startsWith(github.head_ref, 'sdkAuto/') }}
34+
env:
35+
PR_PREFIX: sdkAuto/
36+
if: ${{ github.actor == 'openapi-sdkautomation[bot]' }}
3137
steps:
3238
- uses: actions/checkout@v2
3339

@@ -43,7 +49,7 @@ jobs:
4349
- name: Check RP in Autogenlist
4450
run: |
4551
check_result='';
46-
exec=$(npm run find-basepath ${{ github.head_ref }});
52+
exec=$(npm run find-basepath ${{ github.head_ref }} $PR_PREFIX);
4753
while read line;
4854
do
4955
# overriding check_result until the last line is read, last line contains

generator/cmd/findbasepath.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ executeSynchronous(async () => {
99
}
1010

1111
const prName = process.argv[2];
12-
let basePath = prName.replace("sdkAutomation/", "");
12+
const prPrefix = process.argv[3];
13+
let basePath = prName.replace(prPrefix, "");
1314

1415
// format basePath
1516
basePath = `${basePath}/resource-manager`;

sdkauto_afterscript.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
const basePath = process.argv[2];
2-
require("child_process").execSync(`npm install --prefix generator`, {stdio: 'inherit'});
3-
require("child_process").execSync(`npm run postprocessor ${basePath} --prefix generator`, {stdio: 'inherit'});
4-
require("child_process").execSync(`npm install --prefix tools`, {stdio: 'inherit'});
5-
require("child_process").execSync(`npm run test --prefix tools`, {stdio: 'inherit'});
2+
require("child_process").execSync(`npm install --prefix generator`, {
3+
stdio: "inherit",
4+
});
5+
require("child_process").execSync(
6+
`npm run postprocessor ${basePath} --prefix generator`,
7+
{ stdio: "inherit" }
8+
);
9+
try {
10+
require("child_process").execSync(`npm install --prefix tools`, {
11+
stdio: "inherit",
12+
});
13+
require("child_process").execSync(`npm run test --prefix tools`, {
14+
stdio: "inherit",
15+
});
16+
} catch (e) {
17+
console.error(e);
18+
}

0 commit comments

Comments
 (0)