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

Support collections as values for add, rm and so on #95

Closed
trallnag opened this issue Nov 23, 2020 · 8 comments
Closed

Support collections as values for add, rm and so on #95

trallnag opened this issue Nov 23, 2020 · 8 comments
Assignees
Labels
good first issue Good for newcomers type: feature New feature or feature request
Projects

Comments

@trallnag
Copy link

trallnag commented Nov 23, 2020

Hello, I think it would improve usability if we could use multiple git add commands with within a single action. For example:

- name: Commit changes
      uses: EndBug/add-and-commit@v5
      with:
        author_name: Your Name
        author_email: mail@example.com
        message: "Your commit message"
        add:
            - "something/file.txt"
            - "crazy/*"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This wouldn't even be a breaking change if both collections and scalars are supported.

At the moment it is possible to to it like this git add file-1 file-2 file-3, which translates to add: file-1 file-2 file-3, but what if the path has a space in it?

@trallnag trallnag changed the title [enhancement] Use collections as values for add, rm and so on [enhancement] Support collections as values for add, rm and so on Nov 23, 2020
@EndBug EndBug self-assigned this Nov 23, 2020
@EndBug EndBug added good first issue Good for newcomers type: feature New feature or feature request labels Nov 23, 2020
@EndBug EndBug added this to To do in Main board via automation Nov 23, 2020
@EndBug EndBug changed the title [enhancement] Support collections as values for add, rm and so on Support collections as values for add, rm and so on Nov 23, 2020
@EndBug
Copy link
Owner

EndBug commented Nov 23, 2020

Seems like a good idea, I'll try to add it as soon as I manage to find the time to ;)

@EndBug
Copy link
Owner

EndBug commented Nov 25, 2020

Hi, I've looked into adding it, but it seems like GH actions inputs only support strings: the only thing I can do is parsing a JSON/YAML array from them.
What do you suggest?

@trallnag
Copy link
Author

Well, that's a bummer. And yeah, probably parsing from JSON or so is the best way to go. It also seems like this is the way other people do it, since it does not seem like this feature will be added in the near future. From what I understand the inputs are available as env vars within the action.

Btw I personally don't need that feature atm, so don't rush yourself or anything like that 😄

@EndBug
Copy link
Owner

EndBug commented Nov 25, 2020

Yeah exactly, in the code their accessed as env variables.
Ok, I'll make it parse JSON/YAML arrays

EndBug added a commit that referenced this issue Nov 29, 2020
@EndBug EndBug moved this from To do to In progress in Main board Nov 29, 2020
@github-actions
Copy link

This issue is being marked as "stale" because it has been open 20 days with no activity. Remove the "stale" label or comment, otherwise this will be closed in 5 days.

@github-actions github-actions bot added the status: stale Inactive issues and PRs label Dec 16, 2020
@EndBug EndBug removed the status: stale Inactive issues and PRs label Dec 16, 2020
EndBug added a commit that referenced this issue Dec 19, 2020
* feat: support arrays as add/remove inputs

re #95

* chore: add debug log for parsed input type
@EndBug
Copy link
Owner

EndBug commented Dec 22, 2020

@all-contributors please add @trallnag for their idea

@allcontributors
Copy link
Contributor

@EndBug

I've put up a pull request to add @trallnag! 🎉

@EndBug
Copy link
Owner

EndBug commented Dec 22, 2020

Ok, I've added this change in a new major version. I've decided to use a major bump just because, even though the previous input format is still valid, this could technically break some commands.

The new version is v6.0.0 (also v6 and latest). I'll close this for now, let me know if you find any issues 👍🏻

@EndBug EndBug closed this as completed Dec 22, 2020
Main board automation moved this from In progress to Done Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: feature New feature or feature request
Projects
No open projects
Main board
  
Done
Development

No branches or pull requests

2 participants