GitHub Create Repository icon

GitHub Create Repository

Create a new GitHub repository

Overview

This node creates a new repository on GitHub either under the authenticated user's account or within an organization. It is useful for automating repository creation workflows, such as setting up new projects programmatically, initializing repositories with specific settings, or integrating repository creation into CI/CD pipelines.

Practical examples include:

  • Automatically creating a private repository for each new project initiated in your system.
  • Creating repositories under an organization with predefined license and gitignore templates.
  • Setting repository merge options and branch deletion policies automatically when creating repos.

Properties

Name Meaning
Owner Type Choose whether to create the repository under your personal user account or under an organization you belong to. Options: "User", "Organization".
Organization If "Owner Type" is "Organization", select the target organization either from a searchable list of organizations you belong to or specify the organization name directly.
Repository Name The name of the new repository to create.
Description A short description of the repository's purpose or content.
Private Whether the repository should be private (true) or public (false).
Initialize README Whether to create an initial commit with an empty README file.
License Template Select an open source license template to apply to the repository. Options include Apache 2.0, BSD 2-Clause, BSD 3-Clause, GPL v3.0, LGPL v2.1, MIT, or None.
Gitignore Template Specify a .gitignore template by name (e.g., "Node", "Python", "VisualStudio") to apply to the repository.
Allow Squash Merge Whether to allow squash merges for pull requests.
Allow Merge Commit Whether to allow merge commits for pull requests.
Allow Rebase Merge Whether to allow rebase merges for pull requests.
Delete Branch on Merge Whether to automatically delete head branches when pull requests are merged.

Output

The node outputs JSON data representing the newly created GitHub repository with detailed information including:

  • Repository identifiers (id, name, full_name)
  • Descriptions and visibility (description, private, visibility)
  • URLs (html_url, clone_url, ssh_url, git_url)
  • Branch and commit info (default_branch, timestamps)
  • Statistics (size, stargazers_count, watchers_count, forks_count, open_issues_count)
  • Repository features and settings (archived, disabled, allow_forking, is_template, topics)
  • License details
  • Merge options (allow_squash_merge, allow_merge_commit, allow_rebase_merge, delete_branch_on_merge)
  • Owner information (login, id, avatar_url, html_url, type)

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with GitHub's REST API.
  • The node uses GitHub's API endpoints to create repositories either under the user or an organization.
  • For organization selection, it fetches the list of organizations the user belongs to via the GitHub API.
  • Proper permissions/scopes must be granted to the API token to create repositories and manage organization repositories if applicable.

Troubleshooting

  • Common issues:

    • Insufficient permissions: The API token may lack scopes required to create repositories or access organizations.
    • Invalid organization name or no membership: When creating under an organization, ensure the organization exists and the user has rights.
    • Repository name conflicts: Trying to create a repository with a name that already exists under the selected owner will cause errors.
    • Network or authentication failures.
  • Error messages:

    • Errors returned from GitHub API will be surfaced, often indicating permission issues or invalid parameters.
    • If the node is set to continue on fail, errors for individual items will be included in the output JSON under an error field.
  • Resolutions:

    • Verify API token permissions and scopes.
    • Confirm organization membership and spelling.
    • Use unique repository names.
    • Check network connectivity and API rate limits.

Links and References

Discussion