From cdb4aa4a5ab09f2a48197993e8c7300ed3b827e7 Mon Sep 17 00:00:00 2001 From: Jackie Li Date: Tue, 30 Jan 2024 15:55:56 +0000 Subject: [PATCH] use env --- .github/workflows/test-env.yaml | 5 +++++ README.md | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/test-env.yaml b/.github/workflows/test-env.yaml index 51c1c1e..52b7994 100644 --- a/.github/workflows/test-env.yaml +++ b/.github/workflows/test-env.yaml @@ -59,6 +59,11 @@ jobs: uses: actions/checkout@v4 - name: Restore cache uses: ./ + env: + AWS_ACCESS_KEY_ID: "Q3AM3UQ867SPQQA43P2F" + AWS_SECRET_ACCESS_KEY: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + # AWS_SESSION_TOKEN: "xxx" + AWS_REGION: "us-east-1" with: endpoint: play.min.io bucket: actions-cache diff --git a/README.md b/README.md index 5bdd03c..5415f9b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,25 @@ jobs: ${{ runner.os }}-yarn- ``` +You can also set env instead of using `with`: + +```yaml + - uses: tespkg/actions-cache@v1 + env: + AWS_ACCESS_KEY_ID: "Q3AM3UQ867SPQQA43P2F" + AWS_SECRET_ACCESS_KEY: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" + # AWS_SESSION_TOKEN: "xxx" + AWS_REGION: "us-east-1" + with: + endpoint: play.min.io + bucket: actions-cache + use-fallback: false + key: test-${{ runner.os }}-${{ github.run_id }} + path: | + test-cache + ~/test-cache +``` + ## Restore keys `restore-keys` works similar to how github's `@actions/cache@v2` works: It search each item in `restore-keys`