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

Tolerate empty lines in artifact-properties #1

Merged

Conversation

artembilan
Copy link
Contributor

The problem with action configuration in YAML:

        artifact-properties: |
          /**/*.zip::zip.name=${{ github.event.repository.name }},zip.deployed=false
          /**/*docs.zip::zip.type=docs
          /**/*dist.zip::zip.type=dist

It visually not obvious that there are some empty lines in the end. Plus end-user may decide to separate those entries with empty lines as well.

  • Fix StringToArtifactPropertiesConverter to use StringUtils.hasText(). The hasLength() does count whitespaces as content

  • Some other suggested by IDEA simple refactoring for the StringToArtifactPropertiesConverter:

    • String.split() never returns null
    • String.substring() without second argument yields to length() internally

The problem with action configuration in YAML:
```
        artifact-properties: |
          /**/*.zip::zip.name=${{ github.event.repository.name }},zip.deployed=false
          /**/*docs.zip::zip.type=docs
          /**/*dist.zip::zip.type=dist

```
It visually not obvious that there are some empty lines in the end.
Plus end-user may decide to separate those entries with empty lines as well.

* Fix `StringToArtifactPropertiesConverter` to use `StringUtils.hasText()`.
The `hasLength()` does count whitespaces as content

* Some other suggested by IDEA simple refactoring for the `StringToArtifactPropertiesConverter`:
   - `String.split()` never returns null
   - `String.substring()` without second argument yields to `length()` internally
@artembilan
Copy link
Contributor Author

@wilkinsona wilkinsona changed the title Fix StringToArtifactPropertiesConverter for empty lines Tolerate empty lines in artifact-properties Nov 19, 2024
@wilkinsona wilkinsona added this to the 0.0.2 milestone Nov 19, 2024
@wilkinsona wilkinsona merged commit db8b007 into spring-io:main Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants