From 0b7ac81cc0ade123f7b195771ae514bc8fc1e7c6 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 1 Nov 2023 16:58:51 +0800 Subject: [PATCH] ci: Switch to 1password connect to avoid rate limit (#3447) * ci: Switch to 1password connect to avoid rate limit Signed-off-by: Xuanwo * Fix typo Signed-off-by: Xuanwo * FIx typo Signed-off-by: Xuanwo * Test Signed-off-by: Xuanwo * Fix typo Signed-off-by: Xuanwo * Migrate all Signed-off-by: Xuanwo * Test Signed-off-by: Xuanwo --------- Signed-off-by: Xuanwo --- .github/scripts/behavior_test/plan.py | 4 ++-- .github/workflows/behavior_test_binding_java.yml | 8 +++++--- .github/workflows/behavior_test_binding_python.yml | 9 ++++++--- .github/workflows/behavior_test_core.yml | 8 +++++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/scripts/behavior_test/plan.py b/.github/scripts/behavior_test/plan.py index c7de32140c77..aae0a2248a25 100755 --- a/.github/scripts/behavior_test/plan.py +++ b/.github/scripts/behavior_test/plan.py @@ -50,9 +50,9 @@ def provided_cases() -> list[dict[str, str]]: # Check if this workflow needs to read secrets. # - # We will check if pattern `secrets.XXX` exist in content. + # We will check if pattern `op://services` exist in content. if not os.getenv("GITHUB_HAS_SECRETS") == "true": - cases[:] = [v for v in cases if "secrets" not in v["content"]] + cases[:] = [v for v in cases if "op://services" not in v["content"]] # Remove content from cases. cases = [ diff --git a/.github/workflows/behavior_test_binding_java.yml b/.github/workflows/behavior_test_binding_java.yml index 3a780d46889e..de70104227e0 100644 --- a/.github/workflows/behavior_test_binding_java.yml +++ b/.github/workflows/behavior_test_binding_java.yml @@ -47,10 +47,12 @@ jobs: # TODO: 1password is only supported on linux # # Waiting for https://github.com/1Password/load-secrets-action/issues/46 - - name: Setup service account token for 1password + - name: Setup 1Password Connect if: runner.os == 'Linux' - shell: bash - run: echo "OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}" >> $GITHUB_ENV + uses: 1password/load-secrets-action/configure@v1 + with: + connect-host: ${{ secrets.OP_CONNECT_HOST }} + connect-token: ${{ secrets.OP_CONNECT_TOKEN }} - name: Test Core uses: ./.github/actions/behavior_test_binding_java diff --git a/.github/workflows/behavior_test_binding_python.yml b/.github/workflows/behavior_test_binding_python.yml index ed6b099d20f2..6c5c09bebbe1 100644 --- a/.github/workflows/behavior_test_binding_python.yml +++ b/.github/workflows/behavior_test_binding_python.yml @@ -47,10 +47,13 @@ jobs: # TODO: 1password is only supported on linux # # Waiting for https://github.com/1Password/load-secrets-action/issues/46 - - name: Setup service account token for 1password + - name: Setup 1Password Connect if: runner.os == 'Linux' - shell: bash - run: echo "OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}" >> $GITHUB_ENV + uses: 1password/load-secrets-action/configure@v1 + with: + connect-host: ${{ secrets.OP_CONNECT_HOST }} + connect-token: ${{ secrets.OP_CONNECT_TOKEN }} + - uses: actions/setup-python@v4 with: python-version: '3.11' diff --git a/.github/workflows/behavior_test_core.yml b/.github/workflows/behavior_test_core.yml index 03d542f26a3c..4f7fdff62718 100644 --- a/.github/workflows/behavior_test_core.yml +++ b/.github/workflows/behavior_test_core.yml @@ -47,10 +47,12 @@ jobs: # TODO: 1password is only supported on linux # # Waiting for https://github.com/1Password/load-secrets-action/issues/46 - - name: Setup service account token for 1password + - name: Setup 1Password Connect if: runner.os == 'Linux' - shell: bash - run: echo "OP_SERVICE_ACCOUNT_TOKEN=${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}" >> $GITHUB_ENV + uses: 1password/load-secrets-action/configure@v1 + with: + connect-host: ${{ secrets.OP_CONNECT_HOST }} + connect-token: ${{ secrets.OP_CONNECT_TOKEN }} - name: Test Core uses: ./.github/actions/behavior_test_core