GitHub Functions
githubLatest
Get the latest JSON structure
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
githubLatestRelease
Get the latest release version
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
githubRelease
Generate a release on GitHub using API
Usage
githubRelease [ --token token ] [ --owner owner ] [ --name name ] [ --expire expire ] 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)
- Found here: https://github.com/$repoOwner/$repoName/settings/keys
- The
tokenmust have the permission to create releases for this repository - Found here: https://github.com/settings/tokens
Think of them of the "source" (user) and "target" (ssh key) access. Both must exist to work.
Arguments
--help- Optional. Flag. Display this help.--handler handler- Optional. Function. Use this error handler instead of the default error handler.--token token- Optional. UsesGITHUB_ACCESS_TOKENif not supplied. Access token for GitHub REST API.--owner owner- Optional. UsesGITHUB_REPOSITORY_OWNERif not supplied. Repository owner of release.--name name- Optional. UsesGITHUB_REPOSITORY_NAMEif not supplied. Repository name to release.--expire expireString- Optional. UsesGITHUB_ACCESS_TOKEN_EXPIREif not supplied. Expiration time for the token.descriptionFilePath- Required. File which exists. Path to file containing release notes (typically markdown)releaseName- Required. String. Name of the release (e.g.v1.0.0)commitish- Required. String. 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
githubPublishDate
Output the publish date for the latest release of ownerRepository
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
githubURLParse
Parse a GitHub URL and return the owner and project
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
githubProjectJSON
Get a project JSON structure
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