// src/detectors/ci.ts
import fs from "fs-extra";
import path from "path";
async function detectCI(repoPath) {
  if (await fs.pathExists(path.join(repoPath, ".github/workflows"))) {
    return { name: "GitHub Actions", logo: "githubactions.svg", type: "ci" };
  }
  if (await fs.pathExists(path.join(repoPath, ".gitlab-ci.yml"))) {
    return { name: "GitLab CI", logo: "gitlab.svg", type: "ci" };
  }
  if (await fs.pathExists(path.join(repoPath, ".circleci"))) {
    return { name: "CircleCI", logo: "circleci.svg", type: "ci" };
  }
  if (await fs.pathExists(path.join(repoPath, ".travis.yml"))) {
    return { name: "Travis CI", logo: "travisci.svg", type: "ci" };
  }
  if (await fs.pathExists(path.join(repoPath, "azure-pipelines.yml"))) {
    return { name: "Azure Pipelines", logo: "azurepipelines.svg", type: "ci" };
  }
  return null;
}

export {
  detectCI
};
