The TypeScript Bot Integration system enables automated, issue-driven operations for release management tasks. Repository maintainers can trigger workflows by creating issues with specific commands, and the bot automatically executes the workflows, posts status updates, and reports results back to the issue.
This page documents the bot integration mechanism that connects GitHub issues to automated workflows. For information about the specific release workflows themselves, see Release Branch Workflow and Publishing Workflows.
The TypeScript repository uses a bot integration system (TypeScript Bot) that:
workflow_dispatch events.This enables maintainers to perform complex release operations through simple issue commands rather than manually running workflows or executing scripts.
Sources: .github/workflows/new-release-branch.yaml19-37 .github/workflows/set-version.yaml19-37 .github/workflows/sync-branch.yaml11-29 .github/workflows/twoslash-repros.yaml19-37
The following diagram maps the logical flow from a natural language command in a GitHub issue to the specific code entities and workflows in the repository.
Sources: .github/workflows/new-release-branch.yaml1-129 .github/workflows/set-version.yaml1-130 .github/workflows/sync-branch.yaml1-104 .github/workflows/twoslash-repros.yaml1-90
All bot-triggered workflows accept a common set of bot-specific input parameters in addition to their functional inputs. These parameters enable the bot to track workflow execution and provide status updates.
| Parameter | Type | Required | Description |
|---|---|---|---|
distinct_id | string | No | A unique identifier for this bot run, used to correlate workflow execution with the triggering issue. |
source_issue | string | No | The GitHub issue number that triggered this workflow. |
requesting_user | string | No | The GitHub username of the user who requested this operation. |
status_comment | string | No | The comment ID where the bot posts status updates. |
When bot inputs are provided, workflows use a custom run-name to identify bot-triggered runs:
This produces run names like "New Release Branch (bot run 12345)" versus just "New Release Branch" for manual runs.
Sources: .github/workflows/new-release-branch.yaml19-37 .github/workflows/set-version.yaml19-37 .github/workflows/sync-branch.yaml11-29 .github/workflows/twoslash-repros.yaml19-37
The new-release-branch.yaml workflow creates a new release branch with updated version numbers and LKG (Last Known Good) compiler.
The workflow performs version updates using sed commands:
package.json version [.github/workflows/new-release-branch.yaml76]versionMajorMinor in src/compiler/corePublic.ts [.github/workflows/new-release-branch.yaml77]versionMajorMinor in tests/baselines/reference/api/typescript.d.ts [.github/workflows/new-release-branch.yaml78]version constant in src/compiler/corePublic.ts [.github/workflows/new-release-branch.yaml79]Sources: .github/workflows/new-release-branch.yaml70-128
The set-version.yaml workflow updates the version on an existing release branch. It performs essentially the same version update operations as the new release branch workflow but targets an existing branch provided via inputs.branch_name [.github/workflows/set-version.yaml58].
Sources: .github/workflows/set-version.yaml75-130
The sync-branch.yaml workflow merges the latest changes from main into a release branch and updates the LKG.
git merge origin/main --no-ff [.github/workflows/sync-branch.yaml64].npx hereby LKG to ensure the branch has the latest built compiler [.github/workflows/sync-branch.yaml66]../lib directory [.github/workflows/sync-branch.yaml68].Sources: .github/workflows/sync-branch.yaml60-104
The twoslash-repros.yaml workflow runs TypeScript code samples from GitHub issues to verify bug reproductions. It uses the microsoft/TypeScript-Twoslash-Repro-Action [.github/workflows/twoslash-repros.yaml85-89].
Sources: .github/workflows/twoslash-repros.yaml1-90
All bot-triggered workflows use a shared GitHub Action to report their status back to the triggering issue.
The action microsoft/typescript-bot-test-triggerer/.github/actions/post-workflow-result@master is called at the end of workflows [.github/workflows/new-release-branch.yaml119-128].
The action only runs when:
if: ${{ !cancelled() && inputs.distinct_id }}) [.github/workflows/new-release-branch.yaml120].distinct_id) are provided [.github/workflows/new-release-branch.yaml120].| Workflow | Success Comment | Failure Comment |
|---|---|---|
new-release-branch.yaml | "I've created ${{ inputs.branch_name }} with version ${{ inputs.package_version }} for you." | "I was unable to create the new release branch." |
set-version.yaml | "I've set the version of ${{ inputs.branch_name }} to ${{ inputs.package_version }} for you." | "I was unable set the version." |
sync-branch.yaml | "I've pulled main into ${{ inputs.branch_name }} for you." | "I was unable merge main into ${{ inputs.branch_name }}." |
Sources: .github/workflows/new-release-branch.yaml122-123 .github/workflows/set-version.yaml123-124 .github/workflows/sync-branch.yaml97-98
Workflows use microsoft/create-github-app-token-via-key-vault to generate a temporary token for the typescript-automation[bot] [.github/workflows/new-release-branch.yaml97-105]. This token is used to bypass branch protection and push directly to release branches [.github/workflows/new-release-branch.yaml114-117].
Workflows configure git with the automation bot identity:
290192711+typescript-automation[bot]@users.noreply.github.com [.github/workflows/new-release-branch.yaml89]typescript-automation[bot] [.github/workflows/new-release-branch.yaml90]Workflows use azure/login to authenticate with Azure Key Vault, which stores the secrets required to generate the GitHub App token [.github/workflows/new-release-branch.yaml92-96].
Sources: .github/workflows/new-release-branch.yaml89-117 .github/workflows/set-version.yaml92-118 .github/workflows/sync-branch.yaml61-92
The bot system also handles recurring maintenance tasks without direct issue commands.
| Workflow | Schedule / Trigger | Purpose |
|---|---|---|
update-package-lock.yaml | Daily (0 6 * * *) | Regenerates package-lock.json, runs tests, and commits updates [.github/workflows/update-package-lock.yaml7-58]. |
nightly.yaml | Daily (0 7 * * *) | Configures the build for nightly release and publishes to @next on npm [.github/workflows/nightly.yaml5-63]. |
insiders.yaml | On push to main | Publishes the latest successful build to the @insiders tag [.github/workflows/insiders.yaml]. |
accept-baselines-fix-lints.yaml | workflow_dispatch | Automatically runs hereby baseline-accept and hereby format, then commits the results [.github/workflows/accept-baselines-fix-lints.yaml33-43]. |
Sources: .github/workflows/update-package-lock.yaml1-86 .github/workflows/nightly.yaml1-66 .github/workflows/accept-baselines-fix-lints.yaml1-68
Refresh this wiki