GitHub Functions
Usage
githubLatest projectName
Get the latest JSON structure
Arguments
projectName- String. Required. Github project name in the form ofowner/repository
Return codes
0- Success1- Environment error2- Argument error
Environment
- GITHUB_ACCESS_TOKEN - String. Access token used for release
Usage
githubLatestRelease projectName
Get the latest release version
Arguments
projectName- String. Required. Github project name in the form ofowner/repository
Return codes
0- Success1- Environment error2- Argument error
Environment
- GITHUB_ACCESS_TOKEN - String. Access token used for release
Usage
githubRelease [ --help ] [ --handler handler ] [ --token token ] [ --owner owner ] [ --name name ] [ --expire expireString ] descriptionFilePath releaseName commitish
Use GitHub API to generate a release
GitHub MUST have two sets of credentials enabled:
- The SSH key for the deployment robot should have push access to the repository on GitHub to enable releases (git handles this)
- The token must have the permission to create releases for this repository
Think of them of the "source" (user) and "target" (ssh key) access. Both must exist to work.
Arguments
--help- Flag. Optional. Display this help.--handler handler- Function. Optional. Use this error handler instead of the default error handler.--token token- String. Optional. UsesGITHUB_ACCESS_TOKENif not supplied. Access token for GitHub REST API.--owner owner- String. Optional. UsesGITHUB_REPOSITORY_OWNERif not supplied. Repository owner of release.--name name- String. Optional. UsesGITHUB_REPOSITORY_NAMEif not supplied. Repository name to release.--expire expireString- String. Optional. UsesGITHUB_ACCESS_TOKEN_EXPIREif not supplied. Expiration time for the token.descriptionFilePath- File. Required. File which exists. Path to file containing release notes (typically markdown)releaseName- String. Required. Name of the release (e.g.v1.0.0)commitish- String. Required. The GIT short SHA tag for the release
Return codes
0- Success1- Environment error2- Argument error
Environment
-
GITHUB_ACCESS_TOKEN- Access to GitHub to publish releases
-
GITHUB_ACCESS_TOKEN_EXPIRE- Date inYYYY-MM-DDformat which represents the date whenGITHUB_ACCESS_TOKENexpires (required)
-
GITHUB_REPOSITORY_OWNER- Owner of the repository (https://github.com/owner)
-
GITHUB_REPOSITORY_NAME- Name of the repository (https://github.com/owner/name)
- GITHUB_ACCESS_TOKEN - String. Access token used for release
Usage
githubPublishDate [ ownerRepository ]
Output the publish date for the latest release of ownerRepository
Arguments
ownerRepository- String. Githubowner/repositorystring
Return codes
0- Success1- Environment error2- Argument error
Usage
githubURLParse url
Parse a GitHub URL and return the owner and project name
Arguments
url- URL. Required. URL to parse.
Return codes
0- Success1- Environment error2- Argument error
Usage
githubProjectJSON
Get a project JSON structure
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
Environment
- GITHUB_ACCESS_TOKEN - String. Access token used for release