File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -148,13 +148,31 @@ jobs:
148148
149149 - name : Checkout target repository
150150 if : env.secret_configured == 'true'
151+ id : checkout-target
152+ continue-on-error : true
151153 uses : actions/checkout@v4
152154 with :
153155 repository : ${{ env.TARGET_REPO }}
154156 token : ${{ secrets.DEMO_REPO_PAT }}
155157 path : target
156158 fetch-depth : 0
157159
160+ - name : Initialize empty target repository
161+ if : env.secret_configured == 'true' && steps.checkout-target.outcome == 'failure'
162+ env :
163+ DEMO_REPO_PAT : ${{ secrets.DEMO_REPO_PAT }}
164+ run : |
165+ echo "Target repository appears to be empty. Initializing..."
166+ mkdir -p target
167+ cd target
168+ git init
169+ git remote add origin "https://x-access-token:${DEMO_REPO_PAT}@github.com/${{ env.TARGET_REPO }}.git"
170+ git config user.name "github-actions[bot]"
171+ git config user.email "github-actions[bot]@users.noreply.github.com"
172+ # Create an initial empty commit so we have a branch to work with
173+ git commit --allow-empty -m "chore: initialize repository"
174+ echo "✓ Initialized empty repository"
175+
158176 - name : Sync demo files to target
159177 if : env.secret_configured == 'true'
160178 run : |
You can’t perform that action at this time.
0 commit comments