This plugin enables the ability to manage GitHub releases GitHub CLI in a Vela pipeline.
Source Code: https://github.com/go-vela/vela-github-release
Registry: https://hub.docker.com/r/target/vela-github-release
NOTE:
Users should refrain from using latest as the tag for the Docker image.
It is recommended to use a semantically versioned tag instead.
Sample of creating a GitHub release:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: create
files: [ gh/common, gh/dev/deploy.yml ]
tag: v0.1.0Sample of creating a GitHub release, attaching all .pdf files in the current directory:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: create
files: [ "*.pdf" ]
tag: v0.1.0Important
This uses Go's implementation of glob patterns
Sample of deleting release files:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: delete
tag: v0.1.0Sample of downloading assets from a release in a project:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: download
tag: v0.1.0Sample of listing releases in a repository:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: listSample of uploading assets to a gh release:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: upload
files: [ changelog.md ]
tag: v0.1.0Sample of uploading assets using glob pattern to a gh release:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: upload
files: [ "*.pdf" ]
tag: v0.1.0Important
This uses Go's implementation of glob patterns
Sample of viewing information about a gh release:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
parameters:
action: view
tag: v0.1.0NOTE: Users should refrain from configuring sensitive information in your pipeline in plain text.
The plugin accepts the following parameters for authentication:
| Parameter | Environment Variable Configuration |
|---|---|
token |
PARAMETER_TOKEN, CONFIG_TOKEN, GH_TOKEN, GITHUB_TOKEN |
Users can use Vela internal secrets to substitute these sensitive values at runtime:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
+ secrets: [github_token]
parameters:
action: create
files: [ gh/common, gh/dev/deploy.yml ]This example will add the secrets to the
ghstep as environment variables:
GITHUB_TOKEN=<value>
The plugin accepts the following files for authentication:
| Parameter | Volume Configuration |
|---|---|
token |
/vela/parameters/github-release/config/token, /vela/secrets/github-release/config/token |
Users can use Vela external secrets to substitute these sensitive values at runtime:
steps:
- name: gh
image: target/vela-github-release:latest
pull: always
+ secrets: [github_token]
parameters:
config:
- github_token: somepersonalaccesstokenThis example will read the secret value in the volume stored at
/vela/secrets/
NOTE:
The plugin supports reading all parameters via environment variables or files.
VELA environments can be found at VELA Environments
Any values set from a file take precedence over values set from the environment.
The following parameters are used to configure the image:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
action |
action to perform against gh | true |
N/A |
PARAMETER_ACTIONCONFIG_ACTION |
hostname |
hostname to set for GitHub instance | true |
github.com |
PARAMETER_HOSTNAMEGH_HOSTGITHUB_HOST |
token |
token to set to authenticate to GitHub instance | true |
N/A |
PARAMETER_TOKENCONFIG_TOKENGH_TOKENGITHUB_TOKEN |
log_level |
set the log level for the plugin | true |
info |
PARAMETER_LOG_LEVELVELA_LOG_LEVELGITHUB_RELEASE_LOG_LEVEL |
version |
version of the gh CLI to install |
false |
v2.14.4 |
PARAMETER_VERSIONVELA_GH_VERSIONGH_VERSION |
The following parameters are used to configure the create action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
draft |
save the release as a draft instead of publishing it | false |
false |
PARAMETER_DRAFTCREATE_DRAFT |
notes |
create release notes | false |
N/A |
PARAMETER_NOTESCREATE_NOTES |
notes_file |
read release notes from file | false |
N/A |
PARAMETER_NOTES_FILECREATE_NOTES_FILE |
files |
file(s) name used to create | false |
N/A |
PARAMETER_FILESGITHUB_RELEASE_FILES |
prerelease |
mark the release as a prerelease | false |
false |
PARAMETER_PRERELEASECREATE_PRERELEASE |
tag |
github tag name to create | true |
N/A |
PARAMETER_TAGGITHUB_RELEASE_TAG |
target |
target branch or commit SHA | true |
main |
PARAMETER_TARGETCREATE_TARGET |
title |
Release title | false |
N/A |
PARAMETER_TITLECREATE_TITLE |
The following parameters are used to configure the delete action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
yes |
skip the delete confirmation prompt | false |
false |
PARAMETER_YESDELETE_YES |
tag |
github tag name to delete | true |
N/A |
PARAMETER_TAGGITHUB_RELEASE_TAG |
The following parameters are used to configure the download action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
directory |
the directory to download files | true |
"." |
PARAMETER_DIRDOWNLOAD_DIR |
patterns |
download only assets that match glob patterns | false |
N/A |
PARAMETER_PATTERNSDOWNLOAD_PATTERNS |
tag |
github tag name to download | true |
N/A |
PARAMETER_TAGGITHUB_RELEASE_TAG |
The following parameters are used to configure the list action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
limit |
maximum number of items to fetch for list action | true |
30 |
PARAMETER_LIMITLIST_LIMIT |
The following parameters are used to configure the upload action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
clobber |
overwrite existing assets of the same name | false |
false |
PARAMETER_CLOBBERUPLOAD_CLOBBER |
files |
file(s) name used to upload | true |
N/A |
PARAMETER_FILESGITHUB_RELEASE_FILES |
tag |
github tag name to upload | true |
N/A |
PARAMETER_TAGGITHUB_RELEASE_TAG |
The following parameters are used to configure the view action:
| Name | Description | Required | Default | Environment Variables |
|---|---|---|---|---|
tag |
github tag name to view | true |
N/A |
PARAMETER_TAGGITHUB_RELEASE_TAG |
web |
open the release in the browser | true |
false |
PARAMETER_WEBVIEW_WEB |
You can start troubleshooting this plugin by tuning the level of logs being displayed:
steps:
- name: github-release
image: target/vela-github-release:latest
pull: always
parameters:
action: create
files: [ gh/common, gh/dev/deploy.yml ]
+ log_level: trace