Open a GitHub pull request
Open a pull request on GitHub via the REST API (POST /repos/{owner}/{repo}/pulls), using a token read from a Kubernetes Secret. Inputs are the repo, head and base branches, and the PR title/body.
Install v1.0.1
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml
Facts
- Category
- Git
- Tags
- curl git
- Entrypoint
open-pr- Template SHA-256
d4116eab5956f2d0245bb57a5234194b187d5d6075334ca895543611bf3186d3- Source
- open-github-pr at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
curlimages/curl | 8.23.0 | sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93 |
Parameters
| Name | Description | Default |
|---|---|---|
head required |
The branch that contains the changes (source). | none |
repo required |
Target repository as owner/name. Example octocat/hello-world |
none |
title required |
none | |
base |
The branch to merge into (target). | main |
body |
empty | |
token-secret-key |
token |
|
token-secret-name |
Kubernetes Secret holding a GitHub token with pull-request write scope. | github-token |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: open-github-pr
labels:
dagweave.io/catalog-item: open-github-pr
annotations:
dagweave.io/catalog-version: "1.0.1"
dagweave.io/catalog-category: "Git"
spec:
entrypoint: open-pr
templates:
- name: open-pr
inputs:
parameters:
# Target repository as "owner/name".
- name: repo
# Branch the changes are on (source).
- name: head
# Branch to merge into (target).
- name: base
default: main
- name: title
- name: body
default: ""
# Secret holding a GitHub token with pull-request write scope.
- name: token-secret-name
default: github-token
- name: token-secret-key
default: token
container:
# curlimages/curl:8.23.0
image: curlimages/curl@sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93
command: [sh, -c]
# Values are passed as env vars, never interpolated into the shell, so a
# title/body containing quotes or metacharacters is safe. The JSON payload
# is assembled with a POSIX escaper (busybox sed) so no jq is needed.
args:
- |
set -eu
esc() { printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g'; }
PAYLOAD=$(printf '{"title":"%s","head":"%s","base":"%s","body":"%s"}' \
"$(esc "${PR_TITLE}")" "$(esc "${PR_HEAD}")" "$(esc "${PR_BASE}")" "$(esc "${PR_BODY}")")
curl -sSf -X POST "https://api.github.com/repos/${PR_REPO}/pulls" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d "${PAYLOAD}"
env:
- name: PR_REPO
value: "{{inputs.parameters.repo}}"
- name: PR_HEAD
value: "{{inputs.parameters.head}}"
- name: PR_BASE
value: "{{inputs.parameters.base}}"
- name: PR_TITLE
value: "{{inputs.parameters.title}}"
- name: PR_BODY
value: "{{inputs.parameters.body}}"
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.token-secret-name}}"
key: "{{inputs.parameters.token-secret-key}}"
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.1 latest 2026-08-02
Move curlimages/curl from 8.11.1 to 8.21.0. Fixable CRITICAL/HIGH drops from 26 to 1.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml -
1.0.0 2026-07-17
Initial release.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/open-github-pr \
-p head=... \
-p repo=octocat/hello-world \
-p title=...
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: open-github-pr-
spec:
workflowTemplateRef:
name: open-github-pr
arguments:
parameters:
- name: head
value: "..."
- name: repo
value: "octocat/hello-world"
- name: title
value: "..."
As a step of a larger workflow
steps:
- - name: open-github-pr
templateRef:
name: open-github-pr
template: open-pr