Dashboard › publish › Distillation
41866f7f-29f7-46bc-80da-15d3a014b578["lore_tm_v1_y1u9J4Sc93S2zdolfdsx2blJS_sj25OabIIoH5tzJHU"]
Date: Sep 8, 2026
src/modules/process-end-state.js exports processEndState, which accepts { context, octokit, inputs, status }, extracts repo/version from inputs, publishRepo and runId (renamed run_id) from context, and issue_number from context.payload.issue.number.processEndState fetches the GitHub Actions workflow run with octokit.rest.actions.getWorkflowRun({ ...publishRepo, run_id }), stores .data as workflowInfo, and creates details containing repo, version, publishRepo, run_id, issue_number, workflowInfo, and status.processEndState always calls postIssueComment({ octokit, details }); when status === "success", it closes the issue via octokit.rest.issues.update({ ...publishRepo, issue_number, state: "closed" }); it then calls reportSession({ details, inputs }).postIssueComment generates a body with githubIssueComment(details) and posts it through octokit.rest.issues.createComment({ ...details.publishRepo, issue_number: details.issue_number, body }).githubIssueComment({ status, workflowInfo, version, repo, run_id }) supports three statuses: failure returns “Failed to publish.” with run logs at ${workflowInfo.html_url}?check_suite_focus=true#step:8 and a branch-deletion link https://github.com/getsentry/${repo}/branches/all?query=${encodeURIComponent(version)}; cancelled returns analogous “Publish workflow cancelled.” text and the same links; success returns Published successfully: [run#${run_id}](${workflowInfo.html_url}); unknown statuses throw Error("Unknown status: '${status}'").reportSession({ details, inputs }) initializes @sentry/node with dsn: process.env.SENTRY_DSN and release ${details.repo}@${details.version}; in Sentry.withScope, it tags repository with details.repo, sets release context to { issue_number: details.issue_number, inputs }, captures the status-derived message/severity, starts then ends a session with the status-derived session status, and finally awaits Sentry.close().sentryInfoFromDetails({ status, repo }) maps failure to { message: "Release failed: ${repo}", severity: "error", status: "crashed" }; cancelled to { message: "Release cancelled: ${repo}", severity: "warn", status: "crashed" }; and success to { message: "Release succeeded: ${repo}", severity: "info", status: "ok" }; unknown statuses throw Error("Unknown status: '${status}'").