@panoptic-it-solutions/coolify-setup 1.1.28 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/git.js CHANGED
@@ -256,8 +256,18 @@ export async function setupGitHub(projectName) {
256
256
  }
257
257
  catch {
258
258
  // Checkout failed - might be worktree issue
259
- // Try to push current branch to develop instead
259
+ // Try to push current branch to develop instead (if fast-forward possible)
260
260
  try {
261
+ // First fetch to check if develop exists remotely
262
+ try {
263
+ run('git fetch origin develop');
264
+ // Check if current branch contains all develop commits (fast-forward possible)
265
+ run(`git merge-base --is-ancestor origin/develop ${currentBranch}`);
266
+ }
267
+ catch {
268
+ // Either develop doesn't exist remotely, or can't fast-forward
269
+ // Try push anyway - will fail if develop exists and diverged
270
+ }
261
271
  run(`git push origin ${currentBranch}:develop -u`);
262
272
  result.developBranchCreated = true;
263
273
  result.repoPushed = true;
@@ -265,7 +275,7 @@ export async function setupGitHub(projectName) {
265
275
  checkoutSucceeded = false;
266
276
  }
267
277
  catch {
268
- result.warnings.push('Failed to push develop branch (checkout failed, possibly worktree conflict)');
278
+ result.warnings.push('Failed to push develop branch (checkout failed, possibly worktree conflict or branches diverged)');
269
279
  checkoutSucceeded = false;
270
280
  }
271
281
  }
@@ -76,12 +76,7 @@ jobs:
76
76
  owner: context.repo.owner,
77
77
  repo: context.repo.repo,
78
78
  title: \`Deploy: \${sourceBranch} -> \${targetBranch}\`,
79
- body: \`Automated deployment PR from \${sourceBranch} to \${targetBranch}.
80
-
81
- **Commit:** \${{ steps.sha.outputs.sha }}
82
- **Image:** \${{ env.REGISTRY }}/\${{ env.PROJECT_NAME }}-app:\${{ steps.sha.outputs.sha }}
83
-
84
- Merge this PR to trigger deployment.\`,
79
+ body: \`Automated deployment PR from \${sourceBranch} to \${targetBranch}.\\n\\n**Commit:** \${{ steps.sha.outputs.sha }}\\n**Image:** \${{ env.REGISTRY }}/\${{ env.PROJECT_NAME }}-app:\${{ steps.sha.outputs.sha }}\\n\\nMerge this PR to trigger deployment.\`,
85
80
  head: sourceBranch,
86
81
  base: targetBranch
87
82
  });
@@ -114,12 +109,7 @@ Merge this PR to trigger deployment.\`,
114
109
  owner: context.repo.owner,
115
110
  repo: context.repo.repo,
116
111
  title: 'Deploy to Production: staging -> main',
117
- body: \`Promote staging to production.
118
-
119
- **Commit:** \${{ steps.sha.outputs.sha }}
120
- **Image:** \${{ env.REGISTRY }}/\${{ env.PROJECT_NAME }}-app:\${{ steps.sha.outputs.sha }}
121
-
122
- Merge this PR to deploy to production.\`,
112
+ body: \`Promote staging to production.\\n\\n**Commit:** \${{ steps.sha.outputs.sha }}\\n**Image:** \${{ env.REGISTRY }}/\${{ env.PROJECT_NAME }}-app:\${{ steps.sha.outputs.sha }}\\n\\nMerge this PR to deploy to production.\`,
123
113
  head: 'staging',
124
114
  base: 'main'
125
115
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoptic-it-solutions/coolify-setup",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "CLI tool for setting up Coolify deployment on Panoptic projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",