Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Update the way github outputs are set
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Rodriguez committed Oct 4, 2023
1 parent 12469f6 commit 0144513
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test-aws-init-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ jobs:
- name: Create IAM roles for IRSA authentication
working-directory: bootstrap/iam
id: iam-create
run: ./iam.sh create ${{ inputs.cluster_name || 'zarf-init-aws-test' }}
run: |
./iam.sh create ${{ inputs.cluster_name || 'zarf-init-aws-test' }}
# Set the IAM role ARNs as GitHub Actions outputs
echo "{ecr-webhook-role-arn}={$ECR_WEBHOOK_ROLE_ARN}" >> "$GITHUB_OUTPUT"
echo "{ecr-credential-helper-role-arn}={$ECR_CREDENTIAL_HELPER_ROLE_ARN}" >> "$GITHUB_OUTPUT"
- name: Zarf init with private ECR registry
working-directory: ./build
Expand Down
6 changes: 3 additions & 3 deletions bootstrap/iam/iam.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ create() {
ECR_WEBHOOK_ROLE_ARN=$(aws iam create-role --role-name ecr-webhook --assume-role-policy-document file://ecr-webhook-role.json --query "Role.Arn" --output text)
ECR_CREDENTIAL_HELPER_ROLE_ARN=$(aws iam create-role --role-name ecr-credential-helper --assume-role-policy-document file://ecr-credential-helper-role.json --query "Role.Arn" --output text)

# Set the IAM role ARNs as GitHub Actions outputs
echo "{ecr-webhook-role-arn}={$ECR_WEBHOOK_ROLE_ARN}" >> "$GITHUB_OUTPUT"
echo "{ecr-credential-helper-role-arn}={$ECR_CREDENTIAL_HELPER_ROLE_ARN}" >> "$GITHUB_OUTPUT"
# Export as env vars to be used as github outputs for zarf init
export ECR_WEBHOOK_ROLE_ARN
export ECR_CREDENTIAL_HELPER_ROLE_ARN

# Attach policies to roles
aws iam attach-role-policy --role-name ecr-webhook --policy-arn "$ECR_WEBHOOK_POLICY_ARN"
Expand Down

0 comments on commit 0144513

Please sign in to comment.