From 79c19e884ddb74561cb01247cd25b99b8b113f3c Mon Sep 17 00:00:00 2001 From: Adam O'Brien Date: Tue, 3 Sep 2024 11:32:01 +0100 Subject: [PATCH] RHCLOUD-34945 - Add pipeline to sync protos (#5) * Add pipeline to sync protos * Add newline * Update sync-protos.yml Updated workflow to include the new directories "relationships" and "resources" under the v1beta1 path --- .github/workflows/sync-protos.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/sync-protos.yml diff --git a/.github/workflows/sync-protos.yml b/.github/workflows/sync-protos.yml new file mode 100644 index 0000000..eb6547b --- /dev/null +++ b/.github/workflows/sync-protos.yml @@ -0,0 +1,33 @@ +name: sync-protos + +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' # every 6 hours. + + +jobs: + build: + name: Sync protos to clients + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - uses: actions/checkout@v4 + - name: Clone inventory-api repo + run: git clone --depth=1 https://github.com/project-kessel/inventory-api.git + - name: Copy proto files + run: | + cp -r inventory-api/api/kessel/inventory/v1/*.proto src/main/proto/kessel/inventory/v1/ + cp -r inventory-api/api/kessel/inventory/v1beta1/relationships/*.proto src/main/proto/kessel/inventory/v1beta1/ + cp -r inventory-api/api/kessel/inventory/v1beta1/resources/*.proto src/main/proto/kessel/inventory/v1beta1/ + rm -rf inventory-api/ + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'Sync updated proto files' + title: Update protos + +