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

Naming convention for inputs and outputs #450

Open
nitrocode opened this issue Sep 12, 2024 · 1 comment
Open

Naming convention for inputs and outputs #450

nitrocode opened this issue Sep 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@nitrocode
Copy link

nitrocode commented Sep 12, 2024

context

It would be nice to have consistent action inputs so this is more predictable.

Perhaps the default opinion can be kebab case and be configurable?

options

kebab case

inputs:
  my-input-to-action:

Official github actions seem to use kebab case

snake case

inputs:
  my_input_to_action:

camel case

inputs:
  filePath:

upperkebab

inputs:
  MY-INPUT-TO-ACTION:

I haven't found an example of this

uppersnake

inputs:
  GITHUB_TOKEN:

mixed (basically no standard)

inputs:
  my-inPut_to_ACTION:

I haven't found an example of this in the wild, however, internally, you may want to use kebab case and pass that input to an upstream action that uses camel case so you may be left with an input like comment-filePath. We wrap multiple upstream actions in private actions which is why comment would need to be prefixed to differentiate the input from other upstream actions used.

references

@nitrocode nitrocode changed the title Naming convention for inputs Naming convention for inputs and outputs Sep 12, 2024
@rhysd
Copy link
Owner

rhysd commented Oct 16, 2024

Since there is no official style guide and actionlint doesn't enforce code styles, I feel that enforcing specific style on inputs/outputs is out of scope of actionlint.

However, it would be nice idea to use consistent naming convention not to confuse people on action's and reusable workflow's inputs/outputs usage 👍. I'll consider to add a check for names are consistent.

@rhysd rhysd added the enhancement New feature or request label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants