{
  "name": "open-github-pr",
  "title": "Open a GitHub pull request",
  "category": "Git",
  "tags": [
    "curl",
    "git"
  ],
  "version": "1.0.1",
  "date": "2026-08-02",
  "notes": "Move curlimages/curl from 8.11.1 to 8.21.0. Fixable CRITICAL/HIGH drops from 26 to 1.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml",
  "entrypoint": "open-pr",
  "parameters": [
    {
      "name": "head",
      "title": "Head branch",
      "description": "The branch that contains the changes (source).",
      "type": "string",
      "required": true
    },
    {
      "name": "repo",
      "title": "Repository",
      "description": "Target repository as owner/name.",
      "type": "string",
      "required": true,
      "example": "octocat/hello-world"
    },
    {
      "name": "title",
      "title": "PR title",
      "type": "string",
      "required": true
    },
    {
      "name": "base",
      "title": "Base branch",
      "description": "The branch to merge into (target).",
      "type": "string",
      "required": false,
      "default": "main"
    },
    {
      "name": "body",
      "title": "PR body",
      "type": "string",
      "required": false,
      "default": ""
    },
    {
      "name": "token-secret-key",
      "title": "Token secret key",
      "type": "string",
      "required": false,
      "default": "token"
    },
    {
      "name": "token-secret-name",
      "title": "Token secret name",
      "description": "Kubernetes Secret holding a GitHub token with pull-request write scope.",
      "type": "string",
      "required": false,
      "default": "github-token"
    }
  ],
  "images": [
    {
      "ref": "curlimages/curl@sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93",
      "repository": "curlimages/curl",
      "tag": "8.23.0",
      "digest": "sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/open-github-pr/1.0.1/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: open-github-pr\n  labels:\n    dagweave.io/catalog-item: open-github-pr\n  annotations:\n    dagweave.io/catalog-version: \"1.0.1\"\n    dagweave.io/catalog-category: \"Git\"\nspec:\n  entrypoint: open-pr\n  templates:\n    - name: open-pr\n      inputs:\n        parameters:\n          # Target repository as \"owner/name\".\n          - name: repo\n          # Branch the changes are on (source).\n          - name: head\n          # Branch to merge into (target).\n          - name: base\n            default: main\n          - name: title\n          - name: body\n            default: \"\"\n          # Secret holding a GitHub token with pull-request write scope.\n          - name: token-secret-name\n            default: github-token\n          - name: token-secret-key\n            default: token\n      container:\n        # curlimages/curl:8.23.0\n        image: curlimages/curl@sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93\n        command: [sh, -c]\n        # Values are passed as env vars, never interpolated into the shell, so a\n        # title/body containing quotes or metacharacters is safe. The JSON payload\n        # is assembled with a POSIX escaper (busybox sed) so no jq is needed.\n        args:\n          - |\n            set -eu\n            esc() { printf '%s' \"$1\" | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\"/\\\\\"/g' | sed ':a;N;$!ba;s/\\n/\\\\n/g'; }\n            PAYLOAD=$(printf '{\"title\":\"%s\",\"head\":\"%s\",\"base\":\"%s\",\"body\":\"%s\"}' \\\n              \"$(esc \"${PR_TITLE}\")\" \"$(esc \"${PR_HEAD}\")\" \"$(esc \"${PR_BASE}\")\" \"$(esc \"${PR_BODY}\")\")\n            curl -sSf -X POST \"https://api.github.com/repos/${PR_REPO}/pulls\" \\\n              -H \"Authorization: Bearer ${GITHUB_TOKEN}\" \\\n              -H \"Accept: application/vnd.github+json\" \\\n              -H \"X-GitHub-Api-Version: 2022-11-28\" \\\n              -d \"${PAYLOAD}\"\n        env:\n          - name: PR_REPO\n            value: \"{{inputs.parameters.repo}}\"\n          - name: PR_HEAD\n            value: \"{{inputs.parameters.head}}\"\n          - name: PR_BASE\n            value: \"{{inputs.parameters.base}}\"\n          - name: PR_TITLE\n            value: \"{{inputs.parameters.title}}\"\n          - name: PR_BODY\n            value: \"{{inputs.parameters.body}}\"\n          - name: GITHUB_TOKEN\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.token-secret-name}}\"\n                key: \"{{inputs.parameters.token-secret-key}}\"\n",
  "templateSha256": "d4116eab5956f2d0245bb57a5234194b187d5d6075334ca895543611bf3186d3",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/open-github-pr",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
