Skip to content

Commit 8911eeb

Browse files
authored
Merge pull request #2333 from Azure/jcotillo/update_ci_autogen
[Automerge CI] Update bot user and error message
2 parents a9cc7dc + 6d1a736 commit 8911eeb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
needs: schema-tests
6565
env:
6666
PR_PREFIX: sdkAuto/
67-
if: ${{ github.event.pull_request.user.login == 'openapi-sdkautomation[bot]' }}
67+
if: ${{ github.event.pull_request.user.login == 'azure-sdk[bot]' }}
6868
steps:
6969
- uses: actions/[email protected]
7070

@@ -90,6 +90,7 @@ jobs:
9090
done <<< "$exec";
9191
9292
if [ $check_result == 'false' ] ; then
93+
echo "Base path: '$basePath' not onboarded for autogeneration" 1>&2
9394
exit 1
9495
fi
9596
working-directory: ./generator

generator/cmd/findbasepath.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { findAutogenEntries } from '../autogenlist';
66
// this function analyzes a branch name and extracts the base path, then proceeds to find it in autogenlist
77
// if not found, it throws an error
88
executeSynchronous(async () => {
9-
if (!process.argv[2]) {
10-
throw new Error("Branch name missing. This cmd expects a branch name with the following format: 'sdkAutomation/[basepath]'");
9+
if (process.argv.length < 4) {
10+
throw new Error("Branch name or Branch prefix missing. This cmd expects a branch name with the following format: branch name -> 'sdkAuto/[basepath]' and branch prefix -> 'sdkAuto/'");
1111
}
1212

13-
const prName = process.argv[2];
14-
const prPrefix = process.argv[3];
15-
let basePath = prName.replace(prPrefix, "");
13+
const branchName = process.argv[2];
14+
const branchPrefix = process.argv[3];
15+
let basePath = branchName.replace(branchPrefix, "");
1616

1717
// format basePath.
1818
basePath = `${basePath}/resource-manager`;
@@ -25,6 +25,6 @@ executeSynchronous(async () => {
2525
return;
2626
}
2727

28-
console.log(`Base path: '${basePath} found in autogenlist.`);
28+
console.log(`Base path: '${basePath} is enabled (default) for autogen.`);
2929
console.log("true");
3030
});

0 commit comments

Comments
 (0)