Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6fb00e2
chore(github-add-comment): copy task from 0.7 to 0.8
gferreir Sep 17, 2026
40acaa9
chore(github-add-comment): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
3f2a1e8
chore(github-add-gist): copy task from 0.2 to 0.3
gferreir Sep 17, 2026
9892cfc
chore(github-add-gist): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
2f02c7b
chore(github-add-labels): copy task from 0.1 to 0.2
gferreir Sep 17, 2026
c879e7c
chore(github-add-labels): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
f754720
chore(github-app-token): copy task from 0.2 to 0.3
gferreir Sep 17, 2026
b7575db
chore(github-app-token): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
ef9dd22
chore(github-close-issue): copy task from 0.2 to 0.3
gferreir Sep 17, 2026
1564d52
chore(github-close-issue): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
d7c287d
chore(github-create-deployment): copy task from 0.2 to 0.3
gferreir Sep 17, 2026
45d11b5
chore(github-create-deployment): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
a69e053
chore(github-create-deployment-status): copy task from 0.1 to 0.2
gferreir Sep 17, 2026
105ad45
chore(github-create-deployment-status): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
bb554d4
chore(github-open-pr): copy task from 0.2 to 0.3
gferreir Sep 17, 2026
33896c5
chore(github-open-pr): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
2534052
chore(github-request-reviewers): copy task from 0.1 to 0.2
gferreir Sep 17, 2026
d5d9b57
chore(github-request-reviewers): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
4047db4
chore(github-set-status): copy task from 0.4 to 0.5
gferreir Sep 17, 2026
37ea62c
chore(github-set-status): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
e7685c9
chore(create-github-release): copy task from 0.1 to 0.2
gferreir Sep 17, 2026
b81b421
chore(create-github-release): bump apiVersion to tekton.dev/v1
gferreir Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions task/create-github-release/0.2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Create Github Release

It is typical to create a Github tag at the moment of release to introduce a checkpoint in your source code history,
but in most cases users will need compiled objects or other assets output, not just the raw source code.

Github Releases are a way to track deliverables in your project. Consider them a snapshot in time of the source,
build output, artifacts, and other metadata associated with a released version of your code.

This `task` can be used to make a github release.

Task can also be used to upload multiple `assets` including `binaries` of the released version and the release notes, with the release.

## Install the Task

```
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/create-github-release/0.2/create-github-release.yaml
```

## Parameters

- **TAG**: A git tag name that will be created with this release (_e.g:_`v1.0.0`).
- **REVISION**: A Git revision to create a release from (branch, tag, sha, ref…) (_default:_`master`).
- **RELEASE_FILE_NAME**: Name of the file that has to be uploaded as release notes (_default:_`release.md`).
- **GITHUB_TOKEN_SECRET**: The name of the `secret` holding the github-token (_default:_`github-token`).
- **GITHUB_TOKEN_SECRET_KEY**: The name of the `secret key` holding the github-token (_default:_`GITHUB_TOKEN`).


## Workspace

- **input**: To mount `asset` which has to be uploaded with the release.
- **source**: Contains Github `repository `on which release has to be made.
- **release-notes**: To mount file that has to provided as `release notes` in the release.


## Secrets

* `Secret` to provide Github `access token` to authenticate to the Github.

Check [this](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) to get personal access token for `Github`.

## Platforms

The Task can be run on `linux/amd64` platform.

## Usage


This task expects a secret named github-token to exists, with a GitHub token in `GITHUB_TOKEN` with enough privileges to create a release.

This task can upload multiple assets with the release on the `github`, in order to do that any volume (supported in workspace)
can be mounted in the workspace named `input` containing all the assets that needs to be uploaded.

Release Notes can also be uploaded with the release by mounting the the release notes file in the workspace named `release-notes`.
Name of the release notes file should also be provided in the params, default is `release.md`.

Release can be created at a particular branch, tag or commit sha, to achieve that,
required branch, tag or commit sha can be added in the param `commitish`.

Github repository on which release has to be performed must be available in the workspace named `source`. This can be done using
[git-clone](https://github.com/tektoncd/catalog/blob/main/task/git-clone/0.1/git-clone.yaml) task as shown [here](../0.2/samples/run.yaml).


To make a release put all the required params, add required secrets and release will be done.

`Secrets` can be created as follows:
```
apiVersion: v1
kind: Secret
metadata:
name: github-token
type: Opaque
stringData:
GITHUB_TOKEN: $(personal_access_token)
```

[This](../0.2/samples) example uses ConfigMap for mounting asset file to the workspace, ConfigMap can be created as follows:

```
kubectl create configmap upload-asset --from-file=file1.txt --from-file=file2.txt
```

### Note


- If case asset is not to be uploaded with the release, then `emptyDir` needs to be mounted in the `workspace` as shown below:

```
workspaces:
- name: input
emptyDir: {}

```
- Task uses image from `quay.io/diagrawa/github-hub` which is based on [this](https://github.com/Divyansh42/github-hub) Dockerfile.
80 changes: 80 additions & 0 deletions task/create-github-release/0.2/create-github-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: create-github-release
labels:
app.kubernetes.io/version: "0.2"
annotations:
tekton.dev/pipelines.minVersion: "0.50.0"
tekton.dev/categories: Git
tekton.dev/tags: github
tekton.dev/displayName: "create github release"
tekton.dev/platforms: "linux/amd64"
spec:
description: >-
This `task` can be used to make a github release.

It is typical to create a Github tag at the moment of release to introduce a
checkpoint in your source code history,but in most cases users will need compiled
objects or other assets output, not just the raw source code.Github Releases are a
way to track deliverables in your project. Consider them a snapshot in time of the
source, build output, artifacts, and other metadata associated with a released version
of your code.

workspaces:
- name: input
- name: source
- name: release-notes
params:
- name: TAG
description: A git tag that will be created with this release (e.g. v1.0.0)
type: string
- name: REVISION
type: string
description: Git revision to create a release from (branch, tag, sha, ref…).
default: master
- name: RELEASE_FILE_NAME
type: string
description: Name of the file that has to be uploaded as release notes.
default: release.md
- name: GITHUB_TOKEN_SECRET
type: string
description: Name of the secret holding the github-token.
default: github-token
- name: GITHUB_TOKEN_SECRET_KEY
type: string
description: Name of the secret key holding the github-token.
default: GITHUB_TOKEN
steps:
- name: create-release
workingDir: $(workspaces.source.path)
image: quay.io/diagrawa/github-hub@sha256:a002e05e3c3362f49dc31b8c16c10d76c6dbd854fdb0f596eaae8ac8b792adfb #tag: latest
script: |
#!/usr/bin/env bash
set -ex

# Appending command to upload multiple release assets.

UPLOAD_ASSET=$(workspaces.input.path)/*
cmd=""
for file in $UPLOAD_ASSET
do
cmd="$cmd\
--attach $file"
done

# Create a release
echo "Creating release $(params.TAG)"

hub release create \
--commitish $(params.REVISION) \
--file $(workspaces.release-notes.path)/$(params.RELEASE_FILE_NAME) \
$cmd \
$(params.TAG)

env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: $(params.GITHUB_TOKEN_SECRET)
key: $(params.GITHUB_TOKEN_SECRET_KEY)
69 changes: 69 additions & 0 deletions task/create-github-release/0.2/samples/run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: create-github-release-pipeline
spec:
workspaces:
- name: shared-workspace
- name: upload
- name: release-notes
tasks:
- name: fetch-repository
taskRef:
name: git-clone
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: https://github.com/divyansh42/aws-cli.git
- name: subdirectory
value: ""
- name: deleteExisting
value: "true"
- name: create-github-release
taskRef:
name: create-github-release
params:
- name: TAG
value: "v1.0"
- name: REVISION
value: master
- name: RELEASE_FILE_NAME
value: release.md
- name: GITHUB_TOKEN_SECRET
value: github-token
- name: GITHUB_TOKEN_SECRET_KEY
value: GITHUB_TOKEN
runAfter:
- fetch-repository
workspaces:
- name: source
workspace: shared-workspace
- name: input
workspace: upload
- name: release-notes
workspace: release-notes
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: create-github-release-pipeline-run
spec:
pipelineRef:
name: create-github-release-pipeline
workspaces:
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
- name: upload
configMap:
name: upload-asset
- name: release-notes
configMap:
name: release-file
7 changes: 7 additions & 0 deletions task/create-github-release/0.2/samples/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: github-token
type: Opaque
stringData:
GITHUB_TOKEN: $(personal-github-token)
Loading
Loading