Skip to content

Commit cfe9898

Browse files
committed
added step conditions
1 parent 3632ef1 commit cfe9898

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,23 @@ jobs:
2525
working-directory: ./tools
2626

2727
- name: Check RP in Autogenlist
28-
run: npm run find-basepath ${{ github.head_ref }}
28+
if: ${{ github.actor == 'AzureSDKAutomation' && startsWith(github.head_ref, 'sdkAutomation') }}
29+
run: |
30+
check_result='';
31+
exec=$(npm run find-basepath ${{ github.head_ref }});
32+
while read line;
33+
do
34+
# overriding check_result until the last line is read, last line contains
35+
# the result to whether or not the basepath was found in autogenlist.
36+
check_result=$line;
37+
echo $check_result;
38+
done <<< "$exec";
39+
40+
echo "AUTOGENLIST_CHECK_RESULT=$check_result" >> $GITHUB_ENV;
2941
working-directory: ./generator
3042

3143
- name: automerge
44+
if: ${{ github.actor == 'AzureSDKAutomation' && startsWith(github.head_ref, 'sdkAutomation') && env.AUTOGENLIST_CHECK_RESULT == 'true' }}
3245
uses: "pascalgn/automerge-action@v0.12.0"
3346
env:
3447
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

generator/cmd/findbasepath.ts

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

1111
const prName = process.argv[2];
12-
let basePath = prName.replace("AzureSDKAutomation:sdkAutomation/", "");
12+
let basePath = prName.replace("sdkAutomation/", "");
1313

1414
// format basePath
1515
basePath = `${basePath}/resource-manager`;

0 commit comments

Comments
 (0)