microsoft/TypeScript · error · Error
Failed to update status comment
Error message
Failed to update status comment
What it means
post-vsts-artifact-comment.mjs updates a pinned GitHub issue comment (STATUS_COMMENT) via the GitHub REST API, retrying once after a 1s delay. If no update succeeds, `posted` stays false and the script throws to surface the CI failure.
Source
Thrown at scripts/post-vsts-artifact-comment.mjs:110
break;
}
const newComment = oldComment.replace(toReplace, `[${emoji} Results](${resultsComment.data.html_url})`);
// Update status comment
await gh.rest.issues.updateComment({
comment_id: STATUS_COMMENT,
owner: "microsoft",
repo: "TypeScript",
body: newComment,
});
// Repeat; someone may have edited the comment at the same time.
await new Promise(resolve => setTimeout(resolve, 1000));
}
if (!posted) {
throw new Error("Failed to update status comment");
}
View on GitHub (pinned to b465fdbfe1)
Solutions
- Verify the token has `issues:write`/comment-write scope and hasn't expired.
- Confirm STATUS_COMMENT id still maps to an existing comment on the target issue.
- Wait out any rate limit and re-run the job once GitHub is healthy.
- Inspect earlier log lines for the HTTP status returned by the API.
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight: confirm the comment exists and token works before the update loop.
try {
await gh.rest.issues.getComment({ comment_id: STATUS_COMMENT, owner: "microsoft", repo: "TypeScript" });
} catch (e) {
core.setFailed(`Status comment ${STATUS_COMMENT} not reachable: ${e.message}`);
} Try / catch
for (let attempt = 0; attempt < 3; attempt++) {
try {
await gh.rest.issues.updateComment({ comment_id: STATUS_COMMENT, owner: "microsoft", repo: "TypeScript", body: newComment });
posted = true; break;
} catch (e) {
if (e.status === 403 || e.status === 429) { await new Promise(r => setTimeout(r, 1000 * (attempt + 1))); continue; }
throw e;
}
} Prevention
- Use a token with comment-write scope and rotate it before expiry.
- Treat 403/429 as retryable with exponential backoff.
- Verify STATUS_COMMENT id maps to a live comment before the run.
When it happens
Trigger: GitHub API returns an error for every updateComment attempt: auth failure, permission error, rate limit (429/403), the comment was deleted, or the runner has no network.
Common situations: Expired or under-scoped GITHUB_TOKEN in CI; rate limiting during heavy release windows; STATUS_COMMENT id no longer exists on the issue.
Related errors
- Unexpected tag name '${tag}'.
- \n '${tsFilePath}' was not updated while configuring for a
- patch does not match. ${tsFilePath}: '${parsedPatch}; packag
- ${task[0]} ${task[1].join(" ")} failed: ${result.stderr && "
AI-assisted analysis of microsoft/TypeScript@b465fdbfe1 (2026-08-12).
Data as JSON: /api/errors/0e42df15f4267f34.
Report an issue: GitHub.