File tree Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ name: Generate gRPC Code
3
3
on :
4
4
push :
5
5
branches :
6
- - main
6
+ - main
7
7
pull_request :
8
8
branches :
9
- - main
9
+ - main
10
10
11
11
jobs :
12
12
generate :
@@ -15,18 +15,36 @@ jobs:
15
15
steps :
16
16
- name : Checkout code
17
17
uses : actions/checkout@v3
18
+ with :
19
+ token : ${{ secrets.GITHUB_TOKEN }}
18
20
19
21
- name : Set up Python
20
- uses : actions/setup-python@v3
22
+ uses : actions/setup-python@v4
21
23
with :
22
- python-version : ' 3.x' # Specify your desired Python version
24
+ python-version : ' 3.x'
23
25
24
26
- name : Install gRPC tools
25
27
run : |
26
28
python3 -m pip install --upgrade pip
27
- pip install grpcio-tools
28
-
29
+ pip install -r requirements.txt
30
+
29
31
- name : Run generate.sh
30
32
run : |
31
- chmod +x ./generate.sh
33
+ chmod +x ./generate.sh
32
34
./generate.sh
35
+ - name : Check for changes
36
+ run : |
37
+ git config --global user.name "github-actions[bot]"
38
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
39
+ git add .
40
+ if ! git diff --cached --quiet; then
41
+ git commit -m "Automated update: Generated Thrift classes"
42
+ else
43
+ echo "No changes detected, skipping commit."
44
+ fi
45
+ - name : Push changes
46
+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
47
+ run : |
48
+ git push origin main
49
+ env :
50
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments