Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secrets Not Set Unless 'environment-variables' Are Specified #347

Open
ironexdev opened this issue Nov 23, 2024 · 1 comment
Open

Secrets Not Set Unless 'environment-variables' Are Specified #347

ironexdev opened this issue Nov 23, 2024 · 1 comment

Comments

@ironexdev
Copy link

Description:

I'm experiencing an issue with the aws-actions/[email protected] GitHub Action where secrets are not being set in the rendered ECS task definition unless I also specify environment-variables, even if it's just a placeholder.

Problem:

When I specify secrets without any environment-variables, the secrets do not appear in the rendered task definition. Here's the configuration that fails to set the secrets:

(ubuntu-latest)

- name: Render Amazon ECS task definition
  id: render-frontend-container
  uses: aws-actions/[email protected]
  with:
    task-definition: rendered-task-def.json
    container-name: frontend
    image: "${{ steps.ecr-login.outputs.registry }}/${{ env.IMAGE_REPOSITORY }}:${{ inputs.IMAGE_VERSION }}"
    secrets: |
      JWT_SECRET=${{ needs.setup.outputs.SSM_PREFIX }}/JWT_SECRET
      SENTRY_AUTH_TOKEN=${{ needs.setup.outputs.SSM_PREFIX }}/SENTRY_AUTH_TOKEN

Workaround:

If I add an environment-variables section - even with just a dummy variable - the secrets are correctly set:

(ubuntu-latest)

- name: Render Amazon ECS task definition
  id: render-frontend-container
  uses: aws-actions/[email protected]
  with:
    task-definition: rendered-task-def.json
    container-name: frontend
    image: "${{ steps.ecr-login.outputs.registry }}/${{ env.IMAGE_REPOSITORY }}:${{ inputs.IMAGE_VERSION }}"
    environment-variables: |
      DUMMY_VAR=placeholder
    secrets: |
      JWT_SECRET=${{ needs.setup.outputs.SSM_PREFIX }}/JWT_SECRET
      SENTRY_AUTH_TOKEN=${{ needs.setup.outputs.SSM_PREFIX }}/SENTRY_AUTH_TOKEN
@Kamilu-Nurudeen
Copy link

I am experiencing the same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants