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

Fail job when required inputs are whitespace strings #42

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

tomjschuster
Copy link
Owner

@tomjschuster tomjschuster commented Oct 28, 2022

If an input parameter contains only whitespace, getInput from @actions/core will succeed as an empty string when required: true. When fetching the Cloudflare Pages project, the "Get Project" url (/accounts/:accountId/pages/projects/:projectId) ends up being shortened to
"List Projects" (/accounts/:accountId/pages/projects) which ends up in a runtime error as a list of projects is returned instead of a single project.

This PR makes the job fail earlier when any required string input is parsed as an empty string, resulting a descriptive input error as opposed to a runtime error later in the flow.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 28, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7837f1d
Status: ✅  Deploy successful!
Preview URL: https://a90a8d56.cloudflare-pages-deploy-action.pages.dev
Branch Preview URL: https://debug-project-error.cloudflare-pages-deploy-action.pages.dev

View logs

@tomjschuster tomjschuster changed the title test missing project name Fail job when required inputs are whitespace strings Oct 28, 2022
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

Successfully merging this pull request may close these issues.

1 participant