Skip to content

GitHub Functions


githubLatest

Get the latest JSON structure

Usage

githubLatest projectName

Get the latest JSON structure

Location: bin/build/tools/github.sh

Arguments

  • projectName - String. Required. Github project name in the form of owner/repository

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Environment

githubLatestRelease

Get the latest release version

Usage

githubLatestRelease projectName

Get the latest release version

Location: bin/build/tools/github.sh

Arguments

  • projectName - String. Required. Github project name in the form of owner/repository

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Environment

githubRelease

Generate a release on GitHub using API

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.

Location: bin/build/tools/github.sh

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. Uses GITHUB_ACCESS_TOKEN if not supplied. Access token for GitHub REST API.
  • --owner owner - String. Optional. Uses GITHUB_REPOSITORY_OWNER if not supplied. Repository owner of release.
  • --name name - String. Optional. Uses GITHUB_REPOSITORY_NAME if not supplied. Repository name to release.
  • --expire expireString - String. Optional. Uses GITHUB_ACCESS_TOKEN_EXPIRE if 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 - Success
  • 1 - Environment error
  • 2 - Argument error

Environment

    • GITHUB_ACCESS_TOKEN - Access to GitHub to publish releases
    • GITHUB_ACCESS_TOKEN_EXPIRE - Date in YYYY-MM-DD format which represents the date when GITHUB_ACCESS_TOKEN expires (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 GitHub Access TokenSecret. 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

Location: bin/build/tools/github.sh

Arguments

  • ownerRepository - String. Github owner/repository string

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - 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

Location: bin/build/tools/github.sh

Arguments

  • url - URL. Required. URL to parse.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

githubProjectJSON

Get a project JSON structure

Usage

githubProjectJSON

Get a project JSON structure

Location: bin/build/tools/github.sh

Arguments

  • none

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Environment

githubVersionLive

Fetch the current live version of software using GitHub APIs

Usage

githubVersionLive [ --help ] [ --handler handler ] [ --name name ] [ --owner owner ]

Fetch the current live version of software using GitHub APIs

Location: bin/build/tools/github.sh

Arguments

  • --help - Flag. Optional. Display this help.
  • --handler handler - Function. Optional. Use this error handler instead of the default error handler.
  • --name name - String. Optional. GitHub repository name to use. If not specified, uses {env:GITHUB_REPOSITORY_NAME}.
  • --owner owner - String. Optional. GitHub repository owner to use. If not specified, uses {env:GITHUB_REPOSITORY_OWNER}.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

Environment


🛠️ Tools · ⬅ Top