0.2.0 • Published 5 years ago

ghac v0.2.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
5 years ago

GitHub GitHub package.json version

GitHub as Code

ghac is a script to automate the creation of GitHub repositories. It takes in a ghac.yml file and creates remote GitHub repositories based on the settings it contains.

Compatibility

This project is compatible with v3 of the GitHub API (REST).

Preview API's

This project uses some of GitHub's API's that are a preview.

The ghac.yml file

The ghac.yml file contains all the properties to create your repository. The following tables list properties, their types, and default values.

Basic Information

PropertyTypeRequiredDefault ValueDescription
nameStringYesNoneName of the repo.
orgStringNoNoneDescription of the repo.
homepageStringNoNoneHomepage for the project.
privateBooleanNofalseFlag the repo as private.
has_issuesBooleanNotrueEnable/disable the issues feature.
has_projectsBooleanNotrueEnable/disable the projects feature.
has_wikiBooleanNotrueEnable/disable the wiki feature.
gitignore_templateStringNoNoneTemplate for a .gitignore file.
license_templateStringNoNoneTemplate for a LICENSE file.
allow_squash_mergeBooleanNotrueOption to allow admins to squash and merge PR's.
allow_merge_commitBooleanNotrueOption to allow create of commit when a PR is merged.
allow_rebase_mergeBooleanNotrueOption to allow admins to rebase and merge PR's
topicsArray\<String>NoNoneTopics of the repository.
auto_security_fixesBooleanNofalseOption to enable automatic security features in the repo.
vulnerability_alertsBooleanNofalseOption to enable vulnerability alerts for the repo.
name: # string, required
org: # string, optional
description: # string, optional
homepage: # string, optional
private: # boolean, optional, default false
has_isues: # boolean, optional, default true
has_projects: # boolean, optional, default true
has_wiki: # boolean, optional, default true
gitignore_template: # string, optional
license_template: # string, optional
allow_squash_merge: # boolean, optional, default true
allow_merge_commit: # boolean, optional, default true
allow_rebase_merge: # boolean, optional, default true
topics: # optional
  - # topic 1
  - # topic 2
  - # topic ...
auto_security_fixes: # boolean
vulnerability_alerts: # boolean

Collaborators

PropertyTypeRequiredDefaultDescription
team_collaboratorsArray\<Object>NoNoneArray of objects requiring the name and permission properties. Only works if part of an organization.
nameStringYesNoneTeam name. Required property when using team_collaborators.
permissionStringYesNoneTeam permissions. Required property when using team_collaborators. Possible values are pull, push, or admin.
user_collaboratorsArrayNoNoneArray of objects requiring the name and permission properties.
nameStringYesNoneTeam name. Required property when using user_collaborators.
permissionStringYesNoneUser permissions. Required property when using team_collaborators. Possible values are pull, push, or admin.
user_collaborators:
  - name: # user name, required with parent
    permission: # string, required with parent
team_collaborators:
  - name: # team name, required with parent
    permission: # string, required with parent

Deploy Keys

PropertyTypeRequiredDefaultDescription
deploy_keysArray\<Object>NoNoneArray of objects each requiring key property.
titleStringNoNoneTitle of the key.
keyStringYesNoneThe contents of the key.
read_onlyBooleanYesfalseIf true, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.
deploy_keys:
  - title: # string
    key: # string
    read_only: # boolean
  - # ...

Projects

PropertyTypeRequiredDefaultDescription
projectsArray\<Object>NoNoneArray of projects for the repo. Required the name field.
nameStringYesNoneName of the project
bodyStringNoNoneThe description of the project
collaboratorsArray\<String>NoNoneArray of user names.
columnsArray\<Objects>NoNoneArray of columns. Requires the name field.
nameStringYesNoneThe name of the column.
cardsArray\<note>NoNoneThe cards in each column. Contains an array of notes.
noteArray\<String>NoNoneNotes on each card.
projects:
  - name: # string, required with parent
    body: # string
    collaborators:
      - # username 1
      - # username 2
      - # ...
    columns:
      - name: # string, required with parent
        cards:
          - # string 1
          - # string 2
          - # string ...

Branches

PropertyTypeRequiredDefaultDescription
branchesArray\<Object>NoNoneArray of branches for the repo. Requires the name property.
nameStringYesNoneThe name of the branch.
protectionObjectNoNoneBranch protection rules.
required_status_checksObjectNoNoneRequired status checks of the branch. Contains the strict and context properties.
strictBooleanNoNoneRequires branches to be up to date before merging.
contextArray\<String>NoNoneThe list of status checks to require in order to merge into this branch
enforce_adminsBooleanNoNoneEnforce rules for repo administrators.
required_pull_request_reviewsObjectNoNoneRequire at least one approving review on a pull request, before merging. Contains dismissal_restrictions, dismiss_stale_reviews, require_code_owner_reviews, and required_approving_review_count properties.
dismissal_restrictionsObjectNoNoneSpecify which users and teams can dismiss pull request reviews. Contains the users and teams properties.
usersArray\<String>NoNoneList of users who can dismiss PR's.
teamsArray\<String>NoNoneList of teams who can dismiss PR's (only for organizations).
dismiss_stale_reviewsBooleanNoNoneSet to true if you want to automatically dismiss approving reviews when someone pushes a new commit.
require_code_owner_reviewsBooleanNoNoneBlock merging until a code owner reviews the PR.
required_approving_review_countIntNoNoneNumber of required approving reviews
restrictionsObjectNoNoneRestrict who can push to this branch.
usersArray\<String>NoNoneUsers who can push to the branch.
teamArray\<String>NoNoneTeams who can push to the branch.
branches:
  - name: # string, required with parent
    protection:
      required_status_checks:
        strict: # boolean
        contexts:
          - # Check 1
          - # Check 2
          - # ...
      enforce_admins: # boolean
      required_pull_request_reviews:
        dismissal_restrictions:
          users:
            - # List of users
          teams:
            - # list of teams
        dismiss_stale_reviews: # boolean
        require_code_owner_reviews: # boolean
        required_approving_review_count: # int
      restrictions:
        users:
          - # List of users
        teams:
          - # List of teams

Pages

PropertyTypeRequiredDefaultDescription
pagesObjectNoNoneEnable pages for your repo. Contains the enabled, branch, and path keys.
enabledBooleanNoNoneSet to true to enable pages.
branchStringNoNoneThe repository branch used to publish your site's source files. Can be either master or gh-pages.
pathStringNoNoneThe repository directory that includes the source files for the Pages site. When branch is master, you can change path to /docs. When branch is gh-pages, you are unable to specify a path other than /.
pages:
  enabled: # boolean
  branch: # branch name
  path: # path