This action transforms a string to kebab, camel and snake case strings. Information: https://en.wikipedia.org/wiki/Letter_case#Special_case_styles
Under the hood we are using Lodash to perform these actions.
You can now consume the action by referencing the v1 branch
uses: dignio/letter-case-action@v1
id: letter_case
with:
string: "feature/branch-1337"
Get the output
- uses: ...
run: |
echo "kebab: ${{ steps.letter_case.outputs.kebab }}"
echo "camel: ${{ steps.letter_case.outputs.camel }}"
echo "snake: ${{ steps.letter_case.outputs.snake }}"
npm install
# This will show the complete output
INPUT_STRING=feature/branch-1337 node index.js
# OUT:
# Converting string to kebab, camel, and snake case
# ::set-output name=kebab::feature-branch-1337
# ::set-output name=camel::featureBranch1337
# ::set-output name=snake::feature_branch_1337
# For tests
npm test
# Testing the compiled script (https://github.com/vercel/ncc)
npm run build
INPUT_STRING=feature/branch-1337 node dist/index.js
See the actions tab for runs of this action! 🚀