File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate OpenAPI based code
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches :
7
+ - master
8
+
9
+ jobs :
10
+ tests :
11
+ name : Generate OpenAPI based code
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ # Setup
16
+ - uses : actions/checkout@v4
17
+ with :
18
+ submodules : recursive
19
+ - name : Update submodules
20
+ run : git submodule update --remote --recursive
21
+ - uses : actions/setup-node@v3
22
+ id : setup_node_id
23
+ with :
24
+ node-version : 18
25
+ - name : actions/setup-java@v3
26
+ uses : actions/setup-java@v3
27
+ with :
28
+ distribution : ' temurin'
29
+ java-version : 17
30
+ architecture : x64
31
+
32
+ # Generate codes
33
+ - run : |
34
+ python3 generate-code.py
35
+ # Run tests
36
+ - run : npm run test
37
+ - run : |
38
+ diff=$(git --no-pager diff --name-only)
39
+ echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
40
+ echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
41
+ - if : ${{ env.DIFF_IS_EMPTY != 'true' }}
42
+ run : |
43
+ git config user.name github-actions
44
+ git config user.email github-actions@github.com
45
+ git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
46
+
47
+ git add src/**
48
+ git commit --allow-empty -m "Codes are generated by openapi"
49
+
50
+ git push origin update-diff-${{ env.CURRENT_DATETIME }}
51
+ gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi" -b "" --label "line-openapi-update"
52
+ env :
53
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments