44 workflow_dispatch :
55 inputs :
66 new_project_name :
7- description : ' The name for the new project.'
7+ description : ' The name for the project.'
88 required : true
9- default : ' New Project Name '
9+ default : ' My Awesome Project '
1010 project_description :
1111 description : ' A short description of the project.'
1212 required : true
4141 # Convert the project name to snake_case for use in filenames and other contexts.
4242 PROJECT_NAME_LOWER=$(echo "${{ github.event.inputs.new_project_name }}" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
4343 echo "project_name_lower=$PROJECT_NAME_LOWER" >> $GITHUB_OUTPUT
44+ # Convert the project name to CamelCase for use in class names.
45+ PROJECT_NAME_CAMEL=$(echo "${{ github.event.inputs.new_project_name }}" | sed -e 's/\b\(.\)/\u\1/g' -e 's/ //g')
46+ echo "project_name_camel=$PROJECT_NAME_CAMEL" >> $GITHUB_OUTPUT
4447
4548 - name : Set homepage URL
4649 id : set-url
@@ -56,12 +59,13 @@ jobs:
5659 # This command finds all files and uses 'sed' to replace all the placeholders.
5760 # The sed delimiter is changed from '/' to '|' to safely handle path names.
5861 find . -type f -not -path './.git/*' -not -path './.github/workflows/*' -exec sed -i \
59- -e "s|{{PROJECT_NAME}}|${{ github.event.inputs.new_project_name }}|g" \
60- -e "s|{{PROJECT_NAME_LOWER}}|${{ steps.set-variables.outputs.project_name_lower }}|g" \
61- -e "s|{{PROJECT_DESCRIPTION}}|${{ github.event.inputs.project_description }}|g" \
62- -e "s|{{PROJECT_REPOSITORY_URL}}|${{ github.server_url }}/${{ github.repository }}|g" \
63- -e "s|{{PROJECT_HOMEPAGE_URL}}|${{ steps.set-url.outputs.homepage_url }}|g" \
64- -e "s|{{CPACK_PACKAGE_CONTACT}}|${{ github.event.inputs.cpack_package_contact }}|g" \
62+ -e "s|{{PROJECT_NAME}}|${{ github.event.inputs.new_project_name }}|g"
63+ -e "s|{{PROJECT_NAME_LOWER}}|${{ steps.set-variables.outputs.project_name_lower }}|g"
64+ -e "s|{{PROJECT_NAME_CAMEL}}|${{ steps.set-variables.outputs.project_name_camel }}|g"
65+ -e "s|{{PROJECT_DESCRIPTION}}|${{ github.event.inputs.project_description }}|g"
66+ -e "s|{{PROJECT_REPOSITORY_URL}}|${{ github.server_url }}/${{ github.repository }}|g"
67+ -e "s|{{PROJECT_HOMEPAGE_URL}}|${{ steps.set-url.outputs.homepage_url }}|g"
68+ -e "s|{{CPACK_PACKAGE_CONTACT}}|${{ github.event.inputs.cpack_package_contact }}|g"
6569 {} +
6670
6771 - name : Remove template-specific files and instructions
8286 body : |
8387 This pull request configures the project from the template with the information you provided.
8488 branch : configure-project-${{ github.run_number }}
85- token : ${{ secrets.GITHUB_TOKEN }}
89+ token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments