3232 GH_TOKEN : ${{ secrets.PAT_TOKEN }} # PAT or GITHUB_TOKEN with write access
3333 run : |
3434 git fetch origin
35-
35+
3636 # --- Check if branch exists remotely ---
3737 if git show-ref --verify --quiet refs/remotes/origin/$GENERATED_BRANCH_NAME; then
3838 echo "✅ Branch $GENERATED_BRANCH_NAME exists remotely."
4646 echo "branch_exists=false" >> $GITHUB_OUTPUT
4747 fi
4848 echo "branch=${GENERATED_BRANCH_NAME}" >> $GITHUB_OUTPUT
49-
49+
5050 # --- Check if PR already exists for this branch ---
5151 OPEN_PR=$(gh pr list --head "$GENERATED_BRANCH_NAME" --state open --json number --jq '.[0].number')
5252 if [ -n "$OPEN_PR" ]; then
@@ -59,14 +59,16 @@ jobs:
5959 fi
6060
6161 - name : Make script executable
62- run : chmod +x ./generate-cookiecutter -template-from-example-project.sh
62+ run : chmod +x ./generate-copier -template-from-example-project.sh
6363
64- - name : Generate cookiecutter template
65- run : ./generate-cookiecutter -template-from-example-project.sh
64+ - name : Generate copier template
65+ run : ./generate-copier -template-from-example-project.sh
6666
67- - name : Copy generated template to {{cookiecutter. app_name}}
67+ - name : Copy generated template to {{app_name}}
6868 run : |
69+ echo "📁 Copying template into {{app_name}}"
6970 rsync -a --delete --exclude='.git' ./example-template/ ./{{app_name}}/
71+ echo "✅ Copy complete"
7072
7173 - name : Commit and push changes
7274 id : commit
7678 echo "no_changes=true" >> $GITHUB_OUTPUT
7779 echo "✅ No changes detected."
7880 else
79- git commit -m "ci: update generated cookiecutter template from example"
81+ git commit -m "ci: update generated copier template from example"
8082 git push origin $GENERATED_BRANCH_NAME
83+ echo "📤 Pushed updates to $GENERATED_BRANCH_NAME"
8184 echo "no_changes=false" >> $GITHUB_OUTPUT
8285 fi
8386
8992 gh pr create \
9093 --base main \
9194 --head $GENERATED_BRANCH_NAME \
92- --title "ci: update generated cookiecutter template from example" \
95+ --title "ci: update generated copier template from example" \
9396 --body "Automated PR created by workflow."
0 commit comments