Skip to content

Commit

Permalink
Fix for secret inheritance for composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed Aug 8, 2023
1 parent 33dfdca commit ddfd974
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/actions/prepare-ptaxsim/action.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Prepare PTAXSIM DB
name: Prepare PTAXSIM database
description: Downloads and extracts the PTAXSIM database file from S3
inputs:
PTAXSIM_DB_BASE_URL:
required: false
type: string
default: "s3://ccao-data-public-us-east-1/ptaxsim"
SECRETS:
description: "Fetch secrets from workflow as JSON"
outputs:
PTAXSIM_VERSION:
description: "PTAXSIM database version"
Expand Down Expand Up @@ -34,7 +36,7 @@ runs:
if: steps.restore_db_cache.outputs.cache-hit != 'true'
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_TO_ASSUME_ARN }}
role-to-assume: ${{ fromJSON(inputs.SECRETS).AWS_IAM_ROLE_TO_ASSUME_ARN }}
aws-region: us-east-1

- name: Fetch database file
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare PTAXSIM DB
- name: Prepare PTAXSIM database
uses: ./.github/actions/prepare-ptaxsim
with:
SECRETS: ${{ toJSON(secrets) }}

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare PTAXSIM DB
- name: Prepare PTAXSIM database
uses: ./.github/actions/prepare-ptaxsim
with:
SECRETS: ${{ toJSON(secrets) }}

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare PTAXSIM DB
- name: Prepare PTAXSIM database
uses: ./.github/actions/prepare-ptaxsim
with:
SECRETS: ${{ toJSON(secrets) }}

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand Down

0 comments on commit ddfd974

Please sign in to comment.