From c83429fdf3fd71b55116381e1bf88b5c952de9c0 Mon Sep 17 00:00:00 2001
From: pmbrull
Date: Fri, 19 Nov 2021 14:16:56 +0100
Subject: [PATCH] Validate on PR and push on main
---
.github/workflows/py-generate.yml | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/py-generate.yml b/.github/workflows/py-generate.yml
index dd4db242372..5ac038eabb0 100644
--- a/.github/workflows/py-generate.yml
+++ b/.github/workflows/py-generate.yml
@@ -6,6 +6,11 @@ on:
- main
paths:
- 'catalog-rest-service/src/main/resources/json/**'
+ pull_request:
+ branches:
+ - main
+ paths:
+ - 'catalog-rest-service/src/main/resources/json/**'
jobs:
generate:
@@ -24,11 +29,14 @@ jobs:
python3 -m venv env
source env/bin/activate
make install_dev
- - name: Commit Models
+ - name: Generate models
run: |
- set -ex
source env/bin/activate
make generate
+ - name: Push models
+ # Push the generated models if we are running in a push to main
+ if: ${{ github.event_name == 'push' }}
+ run: |
git config --global user.name 'open-metadata'
git config --global user.email 'open-metadata@users.noreply.github.com'
git add -A