I noticed that you are already addressing the issue, sorry for this :(
I was trying the same thing just now
steps:
- name: Set default image-name if not provided
id: set-image-name
run: |
slugify() {
echo "$1" | sed -e 's/[^[:alnum:]]/-/g' | tr -s '-' | tr A-Z a-z
}
if [ -z "${{ inputs.image-name }}" ]; then
IMAGE_NAME=$(slugify ${{ github.repository }})-$(slugify ${{ inputs.caprover-app-name }})
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
else
echo "IMAGE_NAME=${{ inputs.image-name }}" >> $GITHUB_ENV
fi
shell: bash
By the way, github.repository should be sufficient for the image-name, as it already includes the GitHub username and the name of the repository itself. Adding the CapRover app name might be redundant, since it is likely to be the same as the repository name, which I assume would be the case for most people.
I noticed that you are already addressing the issue, sorry for this :( I was trying the same thing just now
By the way,
github.repository
should be sufficient for theimage-name
, as it already includes the GitHub username and the name of the repository itself. Adding the CapRover app name might be redundant, since it is likely to be the same as the repository name, which I assume would be the case for most people.