diff --git a/.github/workflows/_check-main.yaml b/.github/workflows/_check-main.yaml index 04b6e40a..cdfae61b 100644 --- a/.github/workflows/_check-main.yaml +++ b/.github/workflows/_check-main.yaml @@ -31,9 +31,6 @@ on: NEED_UPDATE: description: "Where it should be updated" value: ${{ jobs.check-main.outputs.NEED_UPDATE }} - secrets: - CI_TOKEN: - required: true jobs: check-main: diff --git a/.github/workflows/_check-version.yaml b/.github/workflows/_check-version.yaml index e00e3f84..d09a73db 100644 --- a/.github/workflows/_check-version.yaml +++ b/.github/workflows/_check-version.yaml @@ -32,9 +32,6 @@ on: TAG_DIFF_LIST_JSON_LEN: description: "JSON value length of tag difference" value: ${{ jobs.check-version.outputs.TAG_DIFF_LIST_JSON_LEN }} - secrets: - CI_TOKEN: - required: true env: VALD_TAG_LIST_API_URL: https://api.github.com/repos/vdaas/vald/tags diff --git a/.github/workflows/_sync-version.yaml b/.github/workflows/_sync-version.yaml index 3f5acc45..c844ab32 100644 --- a/.github/workflows/_sync-version.yaml +++ b/.github/workflows/_sync-version.yaml @@ -26,13 +26,6 @@ on: type: string default: main required: false - secrets: - CI_USER: - required: true - CI_TOKEN: - required: true - GPG_PRIVATE_KEY: - required: true env: IMAGES: "vdaas/vald-agent-ngt vdaas/vald-discoverer-k8s vdaas/vald-lb-gateway vdaas/vald-manager-index" diff --git a/.github/workflows/_sync.yaml b/.github/workflows/_sync.yaml index 709e310c..e83f85d6 100644 --- a/.github/workflows/_sync.yaml +++ b/.github/workflows/_sync.yaml @@ -17,13 +17,6 @@ on: type: boolean default: false required: false - secrets: - CI_USER: - required: true - CI_TOKEN: - required: true - GPG_PRIVATE_KEY: - required: true env: CI_USER: ${{ secrets.CI_USER }} CI_TOKEN: ${{ secrets.CI_TOKEN }} diff --git a/.github/workflows/client-sync.yaml b/.github/workflows/client-sync.yaml new file mode 100644 index 00000000..47349e61 --- /dev/null +++ b/.github/workflows/client-sync.yaml @@ -0,0 +1,30 @@ +# +# Copyright (C) 2019-2024 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# You may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# DO NOT EDIT +name: "Sync Vald" +on: + workflow_dispatch: + schedule: + - cron: "*/5 * * * *" +jobs: + sync: + uses: ./.github/workflows/sync.yaml + with: + client_type: python + secrets: + CI_USER: ${{ secrets.DISPATCH_USER }} + CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index 894aba03..badaaa13 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -15,29 +15,34 @@ # name: "Sync Vald" on: - workflow_dispatch: - # schedule: - # - cron: "*/5 * * * *" + workflow_call: + inputs: + client_type: + type: "string" + description: "Set client type. e.g) go, python, node, java" + required: true + secrets: + CI_USER: + required: true + CI_TOKEN: + required: true + GPG_PRIVATE_KEY: + required: true jobs: check-main: uses: ./.github/workflows/_check-main.yaml - secrets: - CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} + secrets: inherit sync-main: if: ${{ needs.check-main.outputs.NEED_UPDATE == 'true' }} needs: - check-main uses: ./.github/workflows/_sync.yaml - secrets: - CI_USER: ${{ secrets.DISPATCH_USER }} - CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + secrets: inherit check-version: uses: ./.github/workflows/_check-version.yaml - secrets: - CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} + secrets: inherit sync-version: needs: @@ -50,7 +55,4 @@ jobs: vald_checkout_src_tag_ref: ${{ fromJson(needs.check-version.outputs.TAG_DIFF_LIST_JSON) }} with: vald_checkout_src_tag_ref: ${{ matrix.vald_checkout_src_tag_ref }} - secrets: - CI_USER: ${{ secrets.DISPATCH_USER }} - CI_TOKEN: ${{ secrets.DISPATCH_TOKEN }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + secrets: inherit