Develop #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate gRPC Code | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
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 }} |