Fix check-codegen workflow trigger (#44) #36
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
# This workflow will delete and regenerate the opentelemetry marshaling code using scripts/proto_codegen.sh. | |
# If generating the code produces any changes from what is currently checked in, the workflow will fail and prompt the user to regenerate the code. | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Check Codegen | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- "scripts/**" | |
- "src/snowflake/telemetry/_internal/opentelemetry/proto/**" | |
- "src/snowflake/telemetry/serialize/**" | |
- ".github/workflows/check-codegen.yml" | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- "scripts/**" | |
- "src/snowflake/telemetry/_internal/opentelemetry/proto/**" | |
- "src/snowflake/telemetry/serialize/**" | |
- ".github/workflows/check-codegen.yml" | |
jobs: | |
check-codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Run codegen script | |
run: | | |
rm -rf src/snowflake/telemetry/_internal/opentelemetry/proto/ | |
./scripts/proto_codegen.sh | |
- name: Check for changes | |
run: | | |
git diff --exit-code || { echo "Code generation produced changes! Regenerate the code using ./scripts/proto_codegen.sh"; exit 1; } |