Skip to content

Commit

Permalink
extract work to test
Browse files Browse the repository at this point in the history
  • Loading branch information
rkeur7 committed Oct 29, 2024
1 parent 0a8526e commit a8450b5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/retrieve_secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Retrieve Secrets

on:
workflow_call:
inputs:
environment:
required: true
type: string

jobs:
retrieve-secrets:
runs-on: ubuntu-latest
steps:
- name: Authenticate with AWS
uses: goshippo/shippo-action-workflows/.github/actions/[email protected]
with:
environment: ${{ inputs.environment }}
oidc-name: shippo-php-sdk-pipeline
login-to-ecr: false

- name: Get Speakeasy Secrets Manager
id: get-secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
dev-main-speakeasy-api-key
name-transformation: uppercase
parse-json-secrets: true
23 changes: 4 additions & 19 deletions .github/workflows/sdk_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,9 @@ on:

jobs:
gather-secrets:
runs-on: ubuntu-latest
steps:
- name: Authenticate with AWS
uses: goshippo/shippo-action-workflows/.github/actions/[email protected]
with:
environment: dev-main
oidc-name: shippo-php-sdk-pipeline
login-to-ecr: false

- name: Get Speakeasy Secrets Manager
id: get-secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
dev-main-speakeasy-api-key
name-transformation: uppercase
parse-json-secrets: true
uses: ./.github/workflows/secrets_retrieval.yaml
with:
environment: dev-main

speakeasy_generate:
needs: gather-secrets
Expand All @@ -48,5 +34,4 @@ jobs:
speakeasy_version: latest
env:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ steps.get-secrets.outputs.DEV_MAIN_SPEAKEASY_API_KEY_PHP_API_KEY }} # Reference the secret directly

speakeasy_api_key: ${{ jobs.gather-secrets.outputs.get-secrets.DEV_MAIN_SPEAKEASY_API_KEY_PHP_API_KEY }} # Reference the output directly

0 comments on commit a8450b5

Please sign in to comment.