Closed Tobi-De closed 6 months ago
This would work. Do you think it would be useful to by default "slugify" github.repository
and inputs.caprover-app-name
? Maybe using something like https://github.com/gacts/github-slug (first one I found while searching)?
This would work. Do you think it would be useful to by default "slugify"
github.repository
andinputs.caprover-app-name
? Maybe using something like gacts/github-slug (first one I found while searching)?
Yep, I thought of that too, I think it's a good idea.
I'm going to see how it works and see if I can add it to #4
@adamghill what do you think of this instead ?
github.repository | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z
sed -e 's/[^[:alnum:]]/-/g'
: This replaces any character that is not a letter or a number with a dash.tr -s '-'
: This replaces multiple consecutive dashes with a single dash.tr A-Z a-z
: This converts all uppercase letters to lowercase.This works for me testing on my local. Could that be added at https://github.com/adamghill/build-docker-and-deploy-to-caprover/pull/4/files#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R29?
This works for me testing on my local. Could that be added at #4 (files)?
On it. Are you able to test the github action on local ?
Are you able to test the github action on local
No, unfortunately not. I tend to merge, tag, push, release, and then go to another repo, update that action to point to the new version -- it's a mess.
Maybe https://github.com/nektos/act could help? Or is there a way to write unit tests for GitHub Actions or something?
No, unfortunately not. I tend to merge, tag, push, release, and then go to another repo, update that action to point to the new version -- it's a mess.
That's what I thought, and that's why I'm reluctant to push something I'm not sure will work.
inputs:
image-name:
description: "The name of the docker image to build"
required: false
default: ${{ echo github.repository | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z }}-${{ echo inputs.caprover-app-name | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z}}
Maybe nektos/act could help? Or is there a way to write unit tests for GitHub Actions or something?
I was thinking about this, but I'm not sure it can test a custom action, afaik it's for workflows, so I'll still need to make the action available on the marketplace to test it
my github username contains some upper case character and since it is part of the imageName, docker can't pull it
I was thinking of adding a new property like this