Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix bug in handling repos-file input #25

Merged
merged 4 commits into from
May 19, 2020
Merged

Conversation

alejandrohdezma
Copy link
Member

@alejandrohdezma alejandrohdezma commented May 19, 2020

🐛 The bug

Inputs read by core.getInput are initialized as '' if they aren't present. However we are handling them as undefined:

const file: string | undefined = core.getInput('repos-file')

✔️ The solution

First of all action.yml shouldn't contain any default: '' for non-required inputs, since that is already the initial value.

Second of all inputs should be read as string and checked using:

const file: string = core.getInput('repos-file')

if (!file) {
  //Input is not provided
}

What other changes are included in this PR?

A whole suite of tests for the check.repoFiles() method has been included so we ensure this error won't happen again in the future.

References

This fixes #21

@github-actions github-actions bot added the bug Something isn't working label May 19, 2020
@alejandrohdezma alejandrohdezma merged commit 2473dfb into master May 19, 2020
@alejandrohdezma alejandrohdezma deleted the bug/fix-regression branch May 19, 2020 10:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scala Steward Action on a single project fails
1 participant