Skip to content

Commit

Permalink
Fixed env passing to reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danishkhan24 committed Aug 28, 2024
1 parent 02d9df1 commit 6dc5101
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,23 @@ env:

jobs:

print:
runs-on: ubuntu-latest
outputs:
AWS_REGION: ${{ env.AWS_REGION }}
steps:
- name: Print inputs passed to the reusable workflow
id: step1
run: |
echo "AWS_REGION: $AWS_REGION"
echo "::set-output AWS_REGION=some_var::$AWS_REGION"
ecr_login:
needs:
- print
uses: ./.github/workflows/ecr-login.yml
secrets:
AWS_REGION: ${{ secrets.AWS_REGION }}
with:
AWS_REGION: ${{ needs.print.outputs.AWS_REGION }}

build_and_push_frontend:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ecr-login.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: ECR Login

on:
workflow_call:
inputs:
region:
description: 'AWS Region'
required: true
type: string

jobs:
login:
Expand Down

0 comments on commit 6dc5101

Please sign in to comment.