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

output doesn't work with single space strings #81

Closed
dorner opened this issue Mar 6, 2020 · 4 comments · Fixed by #88
Closed

output doesn't work with single space strings #81

dorner opened this issue Mar 6, 2020 · 4 comments · Fixed by #88

Comments

@dorner
Copy link
Contributor

dorner commented Mar 6, 2020

Describe the bug
When using the output parameter with an empty string, the files are concatenated together without any separator.

Workflow

    - name: Get file changes
      id: get_file_changes
      uses: trilom/file-changes-action@v1.2.0
      with:
        githubToken: ${{ secrets.GITHUB_TOKEN }}
        output: ' '
    - name: Echo file changes
      run: |
        echo Changed files: ${{ steps.get_file_changes.outputs.files }}

Expected behavior
Files should output with spaces between them, e.g. file1 file2. Instead, they are output together: file1file2

@dorner dorner changed the title output doesn't work with empty strings output doesn't work with single space strings Mar 6, 2020
@trilom
Copy link
Owner

trilom commented Mar 19, 2020

This should be all taken care of according to tests and stuff. Please let me know if you see differently

@trilom trilom closed this as completed Mar 19, 2020
@dorner
Copy link
Contributor Author

dorner commented Mar 20, 2020

@trilom this may work in tests but I've confirmed it does not work in a real workflow. It looks like GitHub automatically trims all input strings when you call getInput(). Passing a single space string turns it into an empty string which the code then replaces with 'json'.

@dorner
Copy link
Contributor Author

dorner commented Mar 20, 2020

We'd likely need some kind of sentinel value for this case e.g. the word "space" to represent an empty space.

dorner pushed a commit to dorner/file-changes-action that referenced this issue Mar 23, 2020
trilom added a commit that referenced this issue Mar 23, 2020
#81: Allow single spaces in format
trilom added a commit that referenced this issue Mar 24, 2020
…ace. the assumption here is that 'json' is default, if you use ' ' it will be '' which is the app default, not the action default of 'json'

I don't specifically like the solution in #81 of having a string that represents something.  Not that many people will need the string 'space' over the string ' ' but this is just logical preference for WYSIWYG.
github-actions bot pushed a commit that referenced this issue Mar 25, 2020
`- name: File Changes Action
   uses: trilom/file-changes-action@v1.2.2`

## [1.2.2](v1.2.1...v1.2.2) (2020-03-25)

### Bug Fixes

* **issue_comment:** this needs to return PR info not commit info if before and after explicitly set, else PR ([eee976b](eee976b))
* **naming:** renamed "deleted" to "removed".  sorry if this is breaking for you. ([800537f](800537f))
* **pull_request_synchronize events:** issue with PR Synchronize events, it would return commit files instead of PR files, this is adjusted to return ALL PR files with PR synchronize event ([fb7bcc7](fb7bcc7))
* **space issue:** this should resolve the issue with using a blank space.  the assumption here is that 'json' is default, if you use ' ' it will be '' which is the app default, not the action default of 'json' ([0e4184f](0e4184f)), closes [#81](#81)
@jpmckinney
Copy link

I arrived here from pre-commit/action#7 (comment)

However, I see that the space sentinel value was reverted in 86dd487

So, I assume ' ' Just Works™ now?

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 a pull request may close this issue.

3 participants