From e55c7f1096de4fbfcee541ee48c8d1a2c7c88d8a Mon Sep 17 00:00:00 2001 From: Adam0Brien Date: Mon, 2 Sep 2024 12:28:17 +0100 Subject: [PATCH 1/3] Add pipeline to sync protos --- .github/workflows/sync-protos.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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..08fb963 --- /dev/null +++ b/.github/workflows/sync-protos.yml @@ -0,0 +1,31 @@ +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/*.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 + \ No newline at end of file From 075a37dea4ccdd4ced1a1b45b17a8471671ca4d7 Mon Sep 17 00:00:00 2001 From: Adam0Brien Date: Mon, 2 Sep 2024 13:20:09 +0100 Subject: [PATCH 2/3] Add newline --- .github/workflows/sync-protos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sync-protos.yml b/.github/workflows/sync-protos.yml index 08fb963..63c2429 100644 --- a/.github/workflows/sync-protos.yml +++ b/.github/workflows/sync-protos.yml @@ -28,4 +28,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} commit-message: 'Sync updated proto files' title: Update protos + \ No newline at end of file From c0e5922339ee613de827589d5f528a77194735fb Mon Sep 17 00:00:00 2001 From: Adam O'Brien Date: Mon, 2 Sep 2024 16:59:04 +0100 Subject: [PATCH 3/3] Update sync-protos.yml Updated workflow to include the new directories "relationships" and "resources" under the v1beta1 path --- .github/workflows/sync-protos.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-protos.yml b/.github/workflows/sync-protos.yml index 63c2429..eb6547b 100644 --- a/.github/workflows/sync-protos.yml +++ b/.github/workflows/sync-protos.yml @@ -20,7 +20,8 @@ jobs: - 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/*.proto src/main/proto/kessel/inventory/v1beta1/ + 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 @@ -29,4 +30,4 @@ jobs: commit-message: 'Sync updated proto files' title: Update protos - \ No newline at end of file +