appleboy / lambda-action

GitHub Action for Deploying Lambda code to an existing function
https://github.com/marketplace/actions/aws-lambda-deploy
MIT License
378 stars 56 forks source link

Lambda environment variables disappear #82

Open piotr-zasuwa-sollers-eu opened 1 week ago

piotr-zasuwa-sollers-eu commented 1 week ago

Last week I noticed that all environment variables disappeared during the deployment using your action, but only for one application code. In other repositories, the same configuration works fine. Any idea what is going on? I'm using the latest version and not setting any environment variables using the action. All environment variables are created earlier by Terraform.

piotr-zasuwa-sollers-eu commented 3 days ago

I identified the problem. Our application repository had a ".env" file in the root directory containing some variables used for local development. One of them was the variable "ENVIRONMENT=local". It looks like your action reads that file and variables and uses them as input for updating the lambda configuration. "Local" was identified as a variable name for Lambda variables but had no value so it was never set but in the end caused removing existing variables in Lambda config. We changed the name of the variable from ENVIRONMENT to something else in .env file and it fixed the issue.

appleboy commented 2 days ago

@piotr-zasuwa-sollers-eu Thanks for your report. I will remove the behavior that loads the .env file for initialization.