arazzo: 1.0.1
info:
title: GitHub Create Label and Triage an Issue
summary: Ensure a triage label exists, open an issue, and apply the label to it.
description: >-
A repository triage pattern that guarantees a label exists before tagging
work with it. The workflow creates a label in the repository, opens a new
issue, and then applies the label to that issue using the issue number
returned by the create step. Every step spells out its request inline so the
flow can be read and executed without opening the underlying OpenAPI
description.
version: 1.0.0
x-realizes-capability-ids:
- BC-4200
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4200
capability_name: Software Product Engineering Management
spec: github-issues-api-openapi.yml
confidence: 0.7
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: issuesApi
url: ../openapi/github-issues-api-openapi.yml
type: openapi
workflows:
- workflowId: create-label-and-triage-issue
summary: Create a label, open an issue, then apply the label to the issue.
description: >-
Creates a repository label, opens an issue, and chains the issue number into
a call that adds the label to the issue.
inputs:
type: object
required:
- githubToken
- owner
- repo
- labelName
- labelColor
- issueTitle
properties:
githubToken:
type: string
description: A GitHub token with repo scope, passed as a Bearer credential.
owner:
type: string
description: The account owner of the repository.
repo:
type: string
description: The name of the repository.
labelName:
type: string
description: The name of the label to create and apply.
labelColor:
type: string
description: The hexadecimal color code for the label, without a leading hash.
labelDescription:
type: string
description: A short description of the label.
issueTitle:
type: string
description: The title of the issue to open.
issueBody:
type: string
description: The body of the issue to open.
steps:
- stepId: createLabel
description: Create the triage label in the repository.
operationId: issues/create-label
parameters:
- name: Authorization
in: header
value: Bearer $inputs.githubToken
- name: owner
in: path
value: $inputs.owner
- name: repo
in: path
value: $inputs.repo
requestBody:
contentType: application/json
payload:
name: $inputs.labelName
color: $inputs.labelColor
description: $inputs.labelDescription
successCriteria:
- condition: $statusCode == 201
outputs:
labelName: $response.body#/name
labelUrl: $response.body#/url
- stepId: openIssue
description: Open the issue that will be triaged with the new label.
operationId: issues/create
parameters:
- name: Authorization
in: header
value: Bearer $inputs.githubToken
- name: owner
in: path
value: $inputs.owner
- name: repo
in: path
value: $inputs.repo
requestBody:
contentType: application/json
payload:
title: $inputs.issueTitle
body: $inputs.issueBody
successCriteria:
- condition: $statusCode == 201
outputs:
issueNumber: $response.body#/number
issueUrl: $response.body#/html_url
- stepId: applyLabel
description: >-
Apply the newly created label to the issue using the issue number returned
by the open step.
operationId: issues/add-labels
parameters:
- name: Authorization
in: header
value: Bearer $inputs.githubToken
- name: owner
in: path
value: $inputs.owner
- name: repo
in: path
value: $inputs.repo
- name: issue_number
in: path
value: $steps.openIssue.outputs.issueNumber
requestBody:
contentType: application/json
payload:
labels:
- $steps.createLabel.outputs.labelName
successCriteria:
- condition: $statusCode == 200
outputs:
appliedLabels: $response.body
outputs:
issueNumber: $steps.openIssue.outputs.issueNumber
issueUrl: $steps.openIssue.outputs.issueUrl
labelName: $steps.createLabel.outputs.labelName
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.