From 5ceb9a15034f9331d1dbb7ae71c8971900192fd5 Mon Sep 17 00:00:00 2001 From: Muhammad Rehan Date: Tue, 31 Dec 2024 23:33:02 +0500 Subject: [PATCH] Update pipeline to use default values --- .github/workflows/setup-project.yaml | 4 +--- scaf | 11 +++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/setup-project.yaml b/.github/workflows/setup-project.yaml index 56b3ddb..76db98a 100644 --- a/.github/workflows/setup-project.yaml +++ b/.github/workflows/setup-project.yaml @@ -27,11 +27,9 @@ jobs: - name: Create Project with Scaf shell: bash run: | - IMAGE_TAG=$GITHUB_SHA - echo "Running scaf with sixfeetup/scaf:$IMAGE_TAG" git config --global init.defaultBranch dev git config --global user.email "setup-project--create@example.com" git config --global user.name "CI CD Setup Project" REPO_URL="https://github.com/sixfeetup/scaf-templates.git" - $HOME/.local/bin/scaf myproject --defaults $REPO_URL + $HOME/.local/bin/scaf myproject --use-default $REPO_URL diff --git a/scaf b/scaf index b480a78..8cc8a15 100755 --- a/scaf +++ b/scaf @@ -52,11 +52,10 @@ else COOKIECUTTER_OPTIONS="" fi -DOCKER_RUN_OPTIONS="" - -# Check if --no-input is in COOKIECUTTER_OPTIONS -if [[ "$COOKIECUTTER_OPTIONS" != *"--no-input"* ]]; then - DOCKER_RUN_OPTIONS="-it" +COPIER_RUN_OPTIONS="--defaults" +# Check if --use-default is present in scaf cli arguments +if [[ "$COOKIECUTTER_OPTIONS" != *"--use-default"* ]]; then + COPIER_RUN_OPTIONS="" fi # Check if --challenge is in scaf cli arguments @@ -235,7 +234,7 @@ if [[ "$PYTHON_VERSION" != 3.8 && "$PYTHON_VERSION" != 3.9 && "$PYTHON_VERSION" fi echo "Creating your project..." -uv run --with isort,black,copier copier copy --vcs-ref 443-update-template $REPO_URL . --trust -d "is_challange_mode=$IS_CHALLENGE_MODE" -d "is_project_slug=$COOKIECUTTER_SLUG" +uv run --with isort,black,copier copier copy --vcs-ref 443-update-template $COPIER_RUN_OPTIONS $REPO_URL . --trust -d "is_challange_mode=$IS_CHALLENGE_MODE" -d "is_project_slug=$COOKIECUTTER_SLUG" # Check if cookiecutter was successful