Muokkaa

Jaa


GitHubRelease@0 - GitHub Release v0 task

Use this task to create, edit, or delete a GitHub release.

This version of the task is deprecated; use GitHubRelease@1.

Use this task to create, edit, or delete a GitHub release.

Syntax

# GitHub Release v0
# Create, edit, or delete a GitHub release.
- task: GitHubRelease@0
  inputs:
    gitHubConnection: # string. Required. GitHub connection (OAuth or PAT). 
    repositoryName: '$(Build.Repository.Name)' # string. Required. Repository. Default: $(Build.Repository.Name).
    action: 'create' # 'create' | 'edit' | 'delete'. Required. Action. Default: create.
    #target: '$(Build.SourceVersion)' # string. Required when action = create || action = edit. Target. Default: $(Build.SourceVersion).
    tagSource: 'auto' # 'auto' | 'manual'. Required when action = create. Tag source. Default: auto.
    #tagPattern: # string. Optional. Use when tagSource = auto. Tag Pattern. 
    #tag: # string. Required when action = edit || action = delete || tagSource = manual. Tag. 
    #title: # string. Optional. Use when action = create || action = edit. Release title. 
    #releaseNotesSource: 'file' # 'file' | 'input'. Optional. Use when action = create || action = edit. Release notes source. Default: file.
    #releaseNotesFile: # string. Optional. Use when releaseNotesSource = file. Release notes file path. 
    #releaseNotes: # string. Optional. Use when releaseNotesSource = input. Release notes. 
    #assets: '$(Build.ArtifactStagingDirectory)/*' # string. Optional. Use when action = create || action = edit. Assets. Default: $(Build.ArtifactStagingDirectory)/*.
    #assetUploadMode: 'delete' # 'delete' | 'replace'. Optional. Use when action = edit. Asset upload mode. Default: delete.
    #isDraft: false # boolean. Optional. Use when action = create || action = edit. Draft release. Default: false.
    #isPreRelease: false # boolean. Optional. Use when action = create || action = edit. Pre-release. Default: false.
    #addChangeLog: true # boolean. Optional. Use when action = create || action = edit. Add changelog. Default: true.
  # Changelog configuration
    changeLogCompareToRelease: 'lastFullRelease' # 'lastFullRelease' | 'lastNonDraftRelease' | 'lastNonDraftReleaseByTag'. Required when addChangeLog = true. Compare to. Default: lastFullRelease.
    #changeLogCompareToReleaseTag: # string. Required when changeLogCompareToRelease = lastNonDraftReleaseByTag && addChangeLog = true. Release Tag. 
    changeLogType: 'commitBased' # 'commitBased' | 'issueBased'. Required when addChangeLog = true. Changelog type. Default: commitBased.
    #changeLogLabels: '[{ "label" : "bug", "displayName" : "Bugs", "state" : "closed" }]' # string. Optional. Use when changeLogType = issueBased && addChangeLog = true. Categories. Default: [{ "label" : "bug", "displayName" : "Bugs", "state" : "closed" }].
# GitHub Release v0
# Create, edit, or delete a GitHub release.
- task: GitHubRelease@0
  inputs:
    gitHubConnection: # string. Required. GitHub connection (OAuth or PAT). 
    repositoryName: '$(Build.Repository.Name)' # string. Required. Repository. Default: $(Build.Repository.Name).
    action: 'create' # 'create' | 'edit' | 'delete'. Required. Action. Default: create.
    #target: '$(Build.SourceVersion)' # string. Required when action = create || action = edit. Target. Default: $(Build.SourceVersion).
    tagSource: 'auto' # 'auto' | 'manual'. Required when action = create. Tag source. Default: auto.
    #tag: # string. Required when action = edit || action = delete || tagSource = manual. Tag. 
    #title: # string. Optional. Use when action = create || action = edit. Release title. 
    #releaseNotesSource: 'file' # 'file' | 'input'. Optional. Use when action = create || action = edit. Release notes source. Default: file.
    #releaseNotesFile: # string. Optional. Use when releaseNotesSource = file. Release notes file path. 
    #releaseNotes: # string. Optional. Use when releaseNotesSource = input. Release notes. 
    #assets: '$(Build.ArtifactStagingDirectory)/*' # string. Optional. Use when action = create || action = edit. Assets. Default: $(Build.ArtifactStagingDirectory)/*.
    #assetUploadMode: 'delete' # 'delete' | 'replace'. Optional. Use when action = edit. Asset upload mode. Default: delete.
    #isDraft: false # boolean. Optional. Use when action = create || action = edit. Draft release. Default: false.
    #isPreRelease: false # boolean. Optional. Use when action = create || action = edit. Pre-release. Default: false.
    #addChangeLog: true # boolean. Optional. Use when action = create || action = edit. Add changelog. Default: true.

Inputs

gitHubConnection - GitHub connection (OAuth or PAT)
string. Required.

Specifies the name of the GitHub service connection to use to connect to the GitHub repository. The connection must be based on a GitHub user's OAuth or a GitHub personal access token. For more information about service connections, see Manage service connections.


repositoryName - Repository
string. Required. Default value: $(Build.Repository.Name).

Specifies the name of the GitHub repository where you will create, edit, or delete the GitHub release.


action - Action
string. Required. Allowed values: create, edit, delete. Default value: create.

Specifies the type of release operation to perform. This task can create, edit, or delete a GitHub release.


target - Target
string. Required when action = create || action = edit. Default value: $(Build.SourceVersion).

Specifies the commit SHA you want to use to create the GitHub release, for example 48b11d8d6e92a22e3e9563a3f643699c16fd6e27. You can also use a variable, like $(myCommitSHA), in this field.


tagSource - Tag source
string. Required when action = create. Allowed values: auto (Git tag), manual (User specified tag). Default value: auto.

Specifies the tag you want to use for release creation. The auto (Git tag) option automatically uses the tag that is associated with the Git commit. Use the manual (User specified tag) option to manually provide a tag.


tagPattern - Tag Pattern
string. Optional. Use when tagSource = auto.

Specifies the Git tag pattern by using regex, for example release-v1.*. GitHub release will be created only for commits that have matching Git tag.


tag - Tag
string. Required when action = edit || action = delete || tagSource = manual.

Specifies the tag you want to use when you create, edit, or delete a release. You can also use a variable, like $(myTagName), in this field.


title - Release title
string. Optional. Use when action = create || action = edit.

Specifies the title of the GitHub release. If left empty, the tag will be used as the release title.


releaseNotesSource - Release notes source
string. Optional. Use when action = create || action = edit. Allowed values: file (Release notes file), input (Inline release notes). Default value: file.

Specifies the description of the GitHub release. Use the file (Release notes file) option to use file contents as release notes. Use the input (Inline release notes) option to manually enter release notes.


releaseNotesFile - Release notes file path
string. Optional. Use when releaseNotesSource = file.

Specifies the file that contains the release notes.


releaseNotes - Release notes
string. Optional. Use when releaseNotesSource = input.

Specifies the release notes. Markdown is supported.


assets - Assets
string. Optional. Use when action = create || action = edit. Default value: $(Build.ArtifactStagingDirectory)/*.

Specifies the files you want to upload as assets of the release. You can use wildcard characters to specify multiple files. For example, use $(Build.ArtifactStagingDirectory)/*.zip for build pipelines or use $(System.DefaultWorkingDirectory)/*.zip for release pipelines.

You can also specify multiple patterns, one per line. By default, all files in the $(Build.ArtifactStagingDirectory) directory will be uploaded. For more information about the list of pre-defined variables that are available, see build variables and release variables.


assetUploadMode - Asset upload mode
string. Optional. Use when action = edit. Allowed values: delete (Delete exisiting assets), replace (Replace existing assets). Default value: delete.

Specifies the asset upload mode you want to use. Use the delete (Delete existing assets) option to first delete any existing assets in the release and then upload all assets. Use the replace (Replace existing assets) option to replace any assets that have the same name.


isDraft - Draft release
boolean. Optional. Use when action = create || action = edit. Default value: false.

Indicates whether you want to save the release as a draft (unpublished). If false, the release will be published.


isPreRelease - Pre-release
boolean. Optional. Use when action = create || action = edit. Default value: false.

Indicates whether you want to mark the release as a pre-release.


addChangeLog - Add changelog
boolean. Optional. Use when action = create || action = edit. Default value: true.

Specifies if you want to include a changelog. If set to true, a list of changes (commits and issues) between the current release and the last published release will be generated and appended to the release notes.


changeLogCompareToRelease - Compare to
string. Required when addChangeLog = true. Allowed values: lastFullRelease (Last full release), lastNonDraftRelease (Last non-draft release), lastNonDraftReleaseByTag (Last non-draft release by tag). Default value: lastFullRelease.

Indicates which release to compare with to generate the changelog:

  • lastFullRelease (Last full release): Compares the current release with the most recent non-draft release that is not marked as pre-release.
  • lastNonDraftRelease (Last non-draft release): Compares the current release with the most recent non-draft release.
  • lastNonDraftReleaseByTag (Last non-draft release by tag): Compares the current release with the last non-draft release matching the specified tag. You can also specify a regex instead of an exact tag.

changeLogCompareToReleaseTag - Release Tag
string. Required when changeLogCompareToRelease = lastNonDraftReleaseByTag && addChangeLog = true.

Specifies the regex for the release tag. A release matching this tag will be used as the base for changelog computation.


changeLogType - Changelog type
string. Required when addChangeLog = true. Allowed values: commitBased (Commit based), issueBased (Issue based). Default value: commitBased.

Specifies the changelog type. A changelog can be commit-based or issue-based. A commit-based changelog lists all commits included in a release. An issue-based changelog lists all the issues or pull requests (PRs) included in the release.


changeLogLabels - Categories
string. Optional. Use when changeLogType = issueBased && addChangeLog = true. Default value: [{ "label" : "bug", "displayName" : "Bugs", "state" : "closed" }].

Categorizes changes based on the label associated with the issue or PR. For a label, you can mention the display name for the category and the state of issue. Examples of labels include: "[{ "label" : "bug", "displayName" : "Bugs", "state" : "closed" }]". In cases where a change has multiple labels on it, the first specified label takes priority. Leave this field empty to see a flat list of issues or PRs.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

There is a newer version of this task available at GitHubRelease@1.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.0.0 or greater
Task category Utility