• Finds and replaces text in a file hosted on a GitHub repository.

    Returns Promise<void>

    Example

    Find and replace text in a file hosted on a GitHub repository

    const octokit = new Octokit({ auth: "your-github-token" });
    await findAndReplaceInGithubFile({
    octokit,
    owner: "username",
    repo: "repository",
    path: "path/to/file.txt",
    regex: /findMe/g,
    replacement: "replaceWithMe",
    commitMessage: "Replaced 'findMe' with 'replaceWithMe'"
    });

    Throws

    Will throw an error if any GitHub API request fails (except for 404 errors, which only log a warning).

Generated using TypeDoc