awslabs / amazon-app-runner-deploy

Registers an AWS AppRunner Service and deploys the application using the source code of a given GitHub repository. Supports both source code and Docker image based service
MIT No Attribution
49 stars 32 forks source link

Ignore empty autoscaling config ARNs #37

Closed odlp closed 1 year ago

odlp commented 1 year ago

Seems like my earlier PR (#33) has broken the action for users who don't want to specify an auto-scaling-config-arn input. I didn't realise @actions/core getInput will return an empty string if a value isn't set, rather than undefined.

Issue #, if available: https://github.com/awslabs/amazon-app-runner-deploy/issues/36

Description of changes:

Notes

The tests for this PR adjust the process environment to specify inputs (mimicking the environment as it would be while the action is running). This approach could also be used in index.test.ts too, as a replacement for FakeInput. This might make the tests simpler (let me know if you'd like a contribution adopting this approach).

Here's the reference for GitHub Actions inputs where I discovered it sets inputs as environment variables, which is what @actions/core getInput ends up reading:

When you specify an input in a workflow file or use a default input value, GitHub creates an environment variable for the input with the name INPUT_. The environment variable created converts input names to uppercase letters and replaces spaces with _ characters.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. I accept