File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Diff check and open pull request
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' master'
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Setup
14
+ uses : actions/checkout@v3
15
+ with :
16
+ submodules : recursive
17
+ - name : Set up Python
18
+ uses : actions/setup-python@v4
19
+ with :
20
+ python-version : ' 3.x'
21
+ - name : Generate codes
22
+ run : python generate-code.py
23
+ - name : Install bump
24
+ run : pip install bump
25
+ - name : Mark if diff exists
26
+ run : |
27
+ diff=$(git --no-pager diff --name-only)
28
+ echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
29
+ echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
30
+
31
+ # # TODO: Enable merge change into master directly
32
+ - name : Open pull request if generated code is not same as current one
33
+ if : ${{ env.DIFF_IS_EMPTY != 'true' }}
34
+ run : |
35
+ git config user.name github-actions
36
+ git config user.email github-actions@github.com
37
+ git checkout -b update-diff-${{ env.CURRENT_DATETIME }}
38
+ bump -m -r linebot/__about__.py
39
+ python generate-code.py
40
+ git add .
41
+ git commit -m "Codes are generated by openapi"
42
+ git push origin update-diff-${{ env.CURRENT_DATETIME }}
43
+ gh pr create -B ${{ github.ref_name }} -t "Codes are generated by openapi" -b ""
44
+ env :
45
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments