Creates a GitHub repository.
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| token | string | The token to use for authorization to GitHub | |
| access | string | Sets an admin collaborator on the repository. Can either be a user reference different from `owner` in `repoUrl` or team reference, eg. `org/team-name` | |
| topics | array | Adds topics to the repository | |
| hasWiki | boolean | Enable the wiki for the repository. The default value is `true` | |
| repoUrl | string | Accepts the format `github.com?repo=reponame&owner=owner` where `reponame` is the new repository name and `owner` is an organization or username | |
| secrets | object | Secrets attached to the repository | |
| autoInit | boolean | - | |
| homepage | string | Repository Homepage | |
| hasIssues | boolean | Enable issues for the repository. The default value is `true` | |
| subscribe | boolean | - | |
| description | string | Repository Description | |
| hasProjects | boolean | Enable projects for the repository. The default value is `true` unless the organization has disabled repository projects | |
| restrictions | object | - | |
| collaborators | array | Provide additional users or teams with permissions | |
| repoVariables | object | Variables attached to the repository | |
| allowAutoMerge | boolean | Allow individual PRs to merge automatically when all merge requirements are met. The default value is `false` | |
| repoVisibility | string | - | |
| allowMergeCommit | boolean | Allow merge commits. The default value is `true` | |
| allowRebaseMerge | boolean | Allow rebase merges. The default value is `true` | |
| allowSquashMerge | boolean | Allow squash merges. The default value is `true` | |
| customProperties | object | Custom properties to be added to the repository (note, this only works for organization repositories). All values must be strings | |
| allowUpdateBranch | boolean | Allow branch to be updated. The default value is `false` | |
| oidcCustomization | object | - | |
| deleteBranchOnMerge | boolean | Delete the branch after merging the PR. The default value is `false` | |
| requiredCommitSigning | boolean | - | |
| requiredLinearHistory | boolean | - | |
| squashMergeCommitTitle | string | - | |
| requireCodeOwnerReviews | boolean | Require an approved review in PR including files with a designated Code Owner | |
| squashMergeCommitMessage | string | - | |
| bypassPullRequestAllowances | object | - | |
| requireBranchesToBeUpToDate | boolean | Require branches to be up to date before merging. The default value is `true` | |
| requiredStatusCheckContexts | array | The list of status checks to require in order to merge into this branch | |
| requiredApprovingReviewCount | number | Specify the number of reviewers required to approve pull requests. Use a number between `1` and `6` or `0` to not require reviewers. Defaults to `1`. | |
| requiredConversationResolution | boolean | Requires all conversations on code to be resolved before a pull request can be merged into this branch |
Output Schema
| Property | Type | Description | Required |
|---|---|---|---|
| remoteUrl | string | A URL to the repository with the provider | |
| repoContentsUrl | string | A URL to the root of the repository |
Usage Examples
Create a new repository in a GitHub organization and push generated code
Creates a repository in a GitHub organization using a repoUrl and then pushes the generated template code. Use this when your template needs a fresh repo before pushing code with github:repo:push.
steps:
- id: fetch-template
action: fetch:template
input:
url: ./template
values:
name: ${{ parameters.repoName }}
description: ${{ parameters.description }}
- id: create-repo
action: github:repo:create
input:
repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}
description: ${{ parameters.description }}
- id: push-initial-code
action: github:repo:push
input:
repoUrl: github.com?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}
sourcePath: .Create a repository on GitHub Enterprise and register it in the catalog
Creates a repository on a GitHub Enterprise Server instance and then registers the service in the catalog. Use this when targeting an internal GHE host and you want to track the new component with catalog:register.
steps:
- id: fetch-template
action: fetch:template
input:
url: ./skeleton
values:
name: ${{ parameters.repoName }}
owner: ${{ parameters.owner }}
system: ${{ parameters.system }}
- id: create-repo
action: github:repo:create
input:
repoUrl: ghe.acme.corp?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}
description: ${{ parameters.description }}
- id: push-code
action: github:repo:push
input:
repoUrl: ghe.acme.corp?owner=${{ parameters.owner }}&repo=${{ parameters.repoName }}
sourcePath: .
- id: register
action: catalog:register
input:
catalogInfoUrl: https://ghe.acme.corp/${{ parameters.owner }}/${{ parameters.repoName }}/blob/main/catalog-info.yaml