Skip to content

Commit

Permalink
chore(ci): use limited access token to checkout repositories
Browse files Browse the repository at this point in the history
This approach allows checkout public and private repository, like
Slab, without to worry too much about secret leakage under certain
circumstances (e.g. under pull request from forks).
The token has just read access on selected repositories.
  • Loading branch information
soonum committed Jan 17, 2025
1 parent a882262 commit 3cfddb6
Show file tree
Hide file tree
Showing 40 changed files with 121 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws_tfhe_backward_compat_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: 'false'
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Install latest stable
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/aws_tfhe_fast_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}
ref: ${{ env.REF }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/aws_tfhe_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: "false"
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Check for file changes
id: changed-files
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: "false"
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Install latest stable
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/aws_tfhe_signed_integer_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: "false"
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Check for file changes
id: changed-files
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: "false"
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Install latest stable
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/aws_tfhe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Check for file changes
id: changed-files
Expand Down Expand Up @@ -165,7 +166,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: 'false'
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Install latest stable
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/aws_tfhe_wasm_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: 'false'
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Install latest stable
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_boolean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand Down Expand Up @@ -103,7 +104,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_core_crypto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand Down Expand Up @@ -94,7 +95,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_erc20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -72,7 +73,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Run benchmarks
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/benchmark_gpu_4090.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -63,7 +64,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Run integer benchmarks
run: |
Expand Down Expand Up @@ -116,7 +118,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -136,7 +139,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Run core crypto benchmarks
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_gpu_core_crypto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Setup Hyperstack dependencies
uses: ./.github/actions/hyperstack_setup
Expand Down Expand Up @@ -108,7 +109,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/benchmark_gpu_erc20_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
type: string
required: true
secrets:
FHE_ACTIONS_TOKEN:
REPO_CHECKOUT_TOKEN:
required: true
SLAB_ACTION_TOKEN:
required: true
Expand Down Expand Up @@ -80,7 +80,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Setup Hyperstack dependencies
uses: ./.github/actions/hyperstack_setup
Expand Down Expand Up @@ -134,7 +135,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/benchmark_gpu_integer_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
type: boolean
default: false
secrets:
FHE_ACTIONS_TOKEN:
REPO_CHECKOUT_TOKEN:
required: true
SLAB_ACTION_TOKEN:
required: true
Expand Down Expand Up @@ -150,7 +150,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Setup Hyperstack dependencies
uses: ./.github/actions/hyperstack_setup
Expand Down Expand Up @@ -210,7 +211,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_integer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -139,7 +140,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Should run benchmarks with all precisions
if: inputs.all_precisions
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_shortint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -102,7 +103,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Run benchmarks with AVX512
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/benchmark_signed_integer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -139,7 +140,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Should run benchmarks with all precisions
if: inputs.all_precisions
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/benchmark_tfhe_fft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/benchmark_tfhe_ntt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/benchmark_tfhe_zk_pok.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
fetch-depth: 0
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Get benchmark details
run: |
Expand All @@ -100,7 +101,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Run benchmarks
run: |
Expand Down Expand Up @@ -131,7 +133,8 @@ jobs:
with:
repository: zama-ai/slab
path: slab
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
persist-credentials: 'false'
token: ${{ secrets.REPO_CHECKOUT_TOKEN }}

- name: Send data to Slab
shell: bash
Expand Down
Loading

0 comments on commit 3cfddb6

Please sign in to comment.