Skip to content

Commit

Permalink
Merge pull request #1352 from Azure/jcotillo/update_basepath_reference
Browse files Browse the repository at this point in the history
Pass pr prefix in gh action
  • Loading branch information
jorgecotillo authored Nov 19, 2020
2 parents 79db396 + dbf76f2 commit b9ee504
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: CI
on:
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -32,7 +31,9 @@ jobs:
automerge:
runs-on: ubuntu-latest
needs: build
if: ${{ contains(github.actor, 'openapi-sdkautomation') && startsWith(github.head_ref, 'sdkAuto/') }}
env:
PR_PREFIX: sdkAuto/
if: ${{ github.actor == 'openapi-sdkautomation' }}
steps:
- uses: actions/checkout@v2

Expand All @@ -48,7 +49,7 @@ jobs:
- name: Check RP in Autogenlist
run: |
check_result='';
exec=$(npm run find-basepath ${{ github.head_ref }});
exec=$(npm run find-basepath ${{ github.head_ref }} $PR_PREFIX);
while read line;
do
# overriding check_result until the last line is read, last line contains
Expand Down
3 changes: 2 additions & 1 deletion generator/cmd/findbasepath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ executeSynchronous(async () => {
}

const prName = process.argv[2];
let basePath = prName.replace("sdkAutomation/", "");
const prPrefix = process.argv[3];
let basePath = prName.replace(prPrefix, "");

// format basePath
basePath = `${basePath}/resource-manager`;
Expand Down

0 comments on commit b9ee504

Please sign in to comment.