forked from Azure/azure-resource-manager-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.54 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CI
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2.1.2
with:
node-version: 10.x
- name: GitHub context (actor and head ref)
run: |
echo ${{ github.actor }}
echo ${{ github.head_ref }}
- name: Install NPM modules
run: npm ci
working-directory: ./tools
- name: Run CI tests
run: npm test
working-directory: ./tools
automerge:
runs-on: ubuntu-latest
needs: build
env:
PR_PREFIX: sdkAuto/
if: ${{ github.actor == 'openapi-sdkautomation[bot]' }}
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2.1.2
with:
node-version: 10.x
- name: Install NPM modules
run: npm ci
working-directory: ./generator
- name: Check RP in Autogenlist
run: |
check_result='';
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
# the result to whether or not the basepath was found in autogenlist.
check_result=$line;
echo $check_result;
done <<< "$exec";
if [ $check_result == 'false' ] ; then
exit 1
fi
working-directory: ./generator