GitHub
Use a GitHub step after a workflow has recorded the repository identity, exact head commit, and approved pull-request title, body, and draft state. It provides one action: create_pull_request.
Configuration
- key: create_pr
name: Create pull request
kind: tool
needs: [observe_remote, resolve_head, approve_proposal, push_branch]
when:
- kind: value_equals
value: "${steps.approve_proposal.outputs.outcome}"
equals: approved
tool:
id: github
action: create_pull_request
inputs:
projectKey: "${workflow.inputs.projectKey}"
remoteName: "${workflow.inputs.remoteName}"
expectedRemoteUrlDigest: "${steps.observe_remote.outputs.remoteUrlDigest}"
baseBranch: "${workflow.inputs.baseBranch}"
headBranch: "${workflow.inputs.headBranch}"
expectedHeadSha: "${steps.resolve_head.outputs.resolvedSha}"
title: "${steps.approve_proposal.outputs.title}"
body: "${steps.approve_proposal.outputs.body}"
draft: "${steps.approve_proposal.outputs.draft}"
outputs:
outcome: "$.normalized.outcome"
number: "$.normalized.number"
url: "$.normalized.url"| Input | Required | Purpose |
|---|---|---|
projectKey | Yes | Registered Valdr project; a project-scoped run can supply it |
remoteName | Yes | Configured Git remote, commonly origin |
expectedRemoteUrlDigest | Yes | Frozen remote identity from Git remote_status |
baseBranch | Yes | Pull-request target branch |
headBranch | Yes | Published source branch |
expectedHeadSha | Yes | Exact approved head commit |
title, body, draft | Yes | Approved pull-request proposal |
Valdr resolves the repository from projectKey and supplies the request identity. The action creates the pull request or adopts the matching existing same-repository request. A changed remote, head commit, or proposal blocks publication instead of silently publishing different work. The workflow host must have the GitHub CLI installed and authenticated for the selected repository.
This fragment assumes the earlier steps recorded the repository and commit, approved the proposal, and used Git push in push_branch to publish that exact commit. Add those steps before creating the pull request; the GitHub step does not approve the proposal or push the branch for you.
Included workflow
The official Valdr Workflow pack includes Create Pull Request (valdr-workflow.pull-request.create). It records local and remote refs, drafts a proposal from the exact diff, lets an authorized operator edit and approve it, rechecks the evidence, pushes the exact head, and creates or adopts the pull request.
Next step
Continue with Run Workflow Steps to reuse the approved publication process. Before publication, use a Human-Gate Step to approve editable pull-request metadata.