-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1307 from Azure/jcotillo/automerge_action
Enable automerge - github action
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { executeSynchronous } from '../utils'; | ||
import { findAutogenEntries } from '../autogenlist'; | ||
|
||
// this function analyzes a branch name and extracts the base path, then proceeds to find it in autogenlist | ||
// if not found, it throws an error | ||
executeSynchronous(async () => { | ||
if (!process.argv[2]) { | ||
throw new Error("Branch name missing. This cmd expects a branch name with the following format: 'sdkAutomation/[basepath]'"); | ||
} | ||
|
||
const prName = process.argv[2]; | ||
let basePath = prName.replace("sdkAutomation/", ""); | ||
|
||
// format basePath | ||
basePath = `${basePath}/resource-manager`; | ||
|
||
const autogenEntries = findAutogenEntries(basePath); | ||
|
||
if (autogenEntries.length === 0) { | ||
//not found | ||
console.log("false"); | ||
return; | ||
} | ||
|
||
console.log(`Base path: '${basePath} found in autogenlist.`); | ||
console.log("true"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters