create-agentic-pdlc 3.1.1 → 3.1.2
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/bin/cli.js +15 -3
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -105,6 +105,11 @@ const i18n = {
|
|
|
105
105
|
'\n⚠️ Dono ou nome do repositório ausente em cli-context.json. Criação automática de labels será pulada.',
|
|
106
106
|
'\n⚠️ Propietario o nombre del repositorio faltante en cli-context.json. Se omitirá la creación automática de etiquetas.'
|
|
107
107
|
),
|
|
108
|
+
protection_private_repo: t(
|
|
109
|
+
'⚠️ GitHub allows Branch Protection only for public repos (or a paid plan).\n 👌 Don\'t worry, the workflow still runs smoothly, but PRs can be merged without approval.',
|
|
110
|
+
'⚠️ O GitHub permite Branch Protection apenas para repos públicos (ou plano pago).\n 👌 Sem problemas, o workflow continua funcionando normalmente, mas PRs podem ser mergeados sem aprovação.',
|
|
111
|
+
'⚠️ GitHub permite Branch Protection solo para repos públicos (o un plan de pago).\n 👌 No te preocupes, el workflow sigue funcionando normalmente, pero los PRs pueden fusionarse sin aprobación.'
|
|
112
|
+
),
|
|
108
113
|
};
|
|
109
114
|
|
|
110
115
|
const cyan = '\x1b[36m';
|
|
@@ -245,10 +250,17 @@ function installHook(sourceDir, targetDir) {
|
|
|
245
250
|
async function setBranchProtection(repo, requiredChecks) {
|
|
246
251
|
console.log(`\n${cyan}${i18n.configuring_protection}${reset}`);
|
|
247
252
|
try {
|
|
248
|
-
const
|
|
249
|
-
'gh', ['api', `repos/${repo}`, '--jq', '.default_branch'],
|
|
253
|
+
const repoInfo = JSON.parse(execFileSync(
|
|
254
|
+
'gh', ['api', `repos/${repo}`, '--jq', '{private: .private, default_branch: .default_branch}'],
|
|
250
255
|
{ stdio: ['ignore', 'pipe', 'ignore'], encoding: 'utf8' }
|
|
251
|
-
).trim()
|
|
256
|
+
).trim());
|
|
257
|
+
|
|
258
|
+
if (repoInfo.private) {
|
|
259
|
+
console.log(` ${yellow}${i18n.protection_private_repo}${reset}`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const defaultBranch = repoInfo.default_branch || 'main';
|
|
252
264
|
|
|
253
265
|
const protectionPayload = JSON.stringify({
|
|
254
266
|
required_status_checks: { strict: false, contexts: requiredChecks },
|