A CNB Issue property update plugin for CI/CD pipelines. Configured through environment variables, it uses the CNB OpenAPI to batch update custom properties of Issues.
Configure in .cnb.yml:
main:
push:
- stages:
- name: issue-property-updater
image: cnbcool/issue-property-updater:latest
settings:
# CNB API endpoint URL, if not provided, uses the default environment variable CNB_API_ENDPOINT value
cnb_api_endpoint: https://api.cnb.cool
# CNB API access token, if not provided, uses the default environment variable CNB_TOKEN value
token: your-api-token
# Repository slug, if not provided, uses the default environment variable CNB_REPO_SLUG value
repo_slug: my_slug/my-repo
# Property update configuration (JSON array)
properties: '[["#123","status","done"]]'
| Parameter Name | Description | Example |
|---|---|---|
cnb_api_endpoint | CNB API endpoint URL, if not provided, uses the default environment variable CNB_API_ENDPOINT value | https://api.cnb.cool |
token | CNB API access token, if not provided, uses the default environment variable CNB_TOKEN value | your-api-token-here |
repo_slug | Repository slug, if not provided, uses the default environment variable CNB_REPO_SLUG value | my-repo |
properties | Property update configuration (JSON array) | [["#123","status","done"]] |
[["#123","status","done"],["repo#456","status","in_progress"]]
"#123" - Use default repository"repo#456" - Specify repository[
{
"repo": "my-group/my-repo",
"issueNumber": 123,
"key": "status",
"value": "done"
}
]
# Set environment variables
export PLUGIN_CNB_API_ENDPOINT="https://api.cnb.cool"
export PLUGIN_CNB_TOKEN="your-api-token"
export PLUGIN_REPO_SLUG="my-repo"
export PLUGIN_PROPERTIES='[["#123","status","done"]]'
# Run plugin
bun src/cli/index.ts
export PLUGIN_PROPERTIES='[
["#123","status","done"],
["#124","status","in_progress"],
["#125","priority","high"]
]'
bun src/cli/index.ts
export PLUGIN_PROPERTIES='[
["repo1#123","status","done"],
["repo2#456","status","in_progress"],
["my-default-repo#789","priority","high"]
]'
bun src/cli/index.ts
bun src/cli/index.ts --verbose --debug
| Option | Description |
|---|---|
-h, --help | Display help information |
--version | Display version information |
-v, --verbose | Enable verbose log output |
-d, --debug | Enable debug mode |
{
"status": "success",
"updated": 3,
"failed": 0,
"issues": [
{
"issue": "#123",
"key": "status",
"success": true
}
],
"totalTime": 1250
}
{
"timestamp": "2026-01-27T10:30:00.000Z",
"level": "error",
"message": "API request failed",
"statusCode": 404,
"retryAttempted": 1,
"issue": "#456",
"key": "status"
}
| Exit Code | Meaning |
|---|---|
| 0 | Success (all properties updated successfully) |
| 1 | Failure (at least one property update failed) |
| 2 | Configuration error |
| 3 | API error |
| 4 | Network error |
[["#123","status","A"],["#123","status","B"]] → final value is "B"# Install dependencies
bun install
# Run type checking
bun run typecheck
# Run linter
bun run lint
# Format code
bun run format
# Build project
bun run build
MIT