-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (41 loc) · 1.21 KB
/
grpc-generate.yml
File metadata and controls
47 lines (41 loc) · 1.21 KB
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
name: Generate gRPC Code
on:
push:
branches:
- main
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install gRPC tools
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run generate.sh
run: |
chmod +x ./generate.sh
./generate.sh
- name: Check for changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff --cached --quiet; then
git commit -m "Automated update: Generated Thrift classes"
else
echo "No changes detected, skipping commit."
fi
- name: Push changes
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git push origin main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}