diff --git a/bin/disinto b/bin/disinto index 652e42d..9515340 100755 --- a/bin/disinto +++ b/bin/disinto @@ -2654,6 +2654,10 @@ disinto_release() { local id="release-${version//./}" local vault_toml="${ops_root}/vault/pending/${id}.toml" + # Read the release formula and inject version + local formula_content + formula_content=$(cat "$formula_path") + # Create vault TOML with the specific version cat > "$vault_toml" </dev/null || true # Push branch + local auth_url + auth_url=$(printf '%s' "http://dev-bot:${FORGE_TOKEN}@$(echo "$FORGE_URL" | sed 's|https\{0,1}://||')" ) + local remote_url="${auth_url}/${PROJECT_REPO%/disinto}/.git" + + if ! git remote get-url origin >/dev/null 2>&1; then + # Get the actual remote URL from FORGE_URL + local forge_host + forge_host=$(echo "$FORGE_URL" | sed 's|https\{0,1}://||' | sed 's|/.*||') + local org_repo + org_repo=$(echo "$PROJECT_REPO" | sed 's|.*||') + remote_url="http://dev-bot:${FORGE_TOKEN}@${forge_host}/${PROJECT_REPO}.git" + fi + git push -u origin "$branch_name" 2>/dev/null || { echo "Error: failed to push branch" >&2 exit 1 diff --git a/vault/examples/release.toml b/vault/examples/release.toml index f8af6d1..bfc823c 100644 --- a/vault/examples/release.toml +++ b/vault/examples/release.toml @@ -9,7 +9,7 @@ # # Example vault item (auto-generated by `disinto release v1.2.0`): # -# id = "release-v120" +# id = "release-v1-2-0" # formula = "release" # context = "Release v1.2.0" # secrets = [] @@ -23,7 +23,7 @@ # 6. restart-agents - Restart agent containers with new image # 7. commit-result - Write release result to tracking file -id = "release-v120" +id = "release-v1-2-0" formula = "release" context = "Release v1.2.0 — includes vault redesign, .profile system, architect agent" secrets = []