Skip to content

Commit

Permalink
ci: Switch to 1password connect to avoid rate limit (#3447)
Browse files Browse the repository at this point in the history
* ci: Switch to 1password connect to avoid rate limit

Signed-off-by: Xuanwo <[email protected]>

* Fix typo

Signed-off-by: Xuanwo <[email protected]>

* FIx typo

Signed-off-by: Xuanwo <[email protected]>

* Test

Signed-off-by: Xuanwo <[email protected]>

* Fix typo

Signed-off-by: Xuanwo <[email protected]>

* Migrate all

Signed-off-by: Xuanwo <[email protected]>

* Test

Signed-off-by: Xuanwo <[email protected]>

---------

Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo authored Nov 1, 2023
1 parent aaae6d7 commit 0b7ac81
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/behavior_test/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/behavior_test_binding_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/behavior_test_binding_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/behavior_test_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b7ac81

Please sign in to comment.