Dashboard › publish › Distillation
3634b2fc-b142-4e01-8cdf-adba41837d36["lore_tm_v1_opTlJjGIZcFmdnFI5bjzgtPicBMMQR85cNnfydAWq0A"]
updateTargets() in src/modules/update-issue.js returns without API calls when stateFilePath is falsy or the file does not exist.updateTargets() concurrently fetches the publish issue via octokit.rest.issues.get() and reads/parses the Craft state file as UTF-8 JSON, then passes craftState and issue.body to transformIssueBody() and updates the issue body via octokit.rest.issues.update().transformIssueBody() in src/modules/update-issue.js rewrites targets inside TARGETS_SECTION_PARSER_REGEX: each target matched by TARGETS_PARSER_REGEX becomes - [x] ${targetId} when craftState.published[targetId] is truthy or - [ ] ${targetId} otherwise.transformIssueBody() tracks declared target IDs in a Set, appends every key from craftState.published not already declared, preserves Object.keys(craftState.published) ordering for those additions, and marks each appended target according to its truthiness in craftState.published.updateIssue({ context, octokit }) in src/modules/update-issue.js derives publishRepo from context.repo and issue_number from context.payload.issue.number; it does not accept or use an inputs argument.updateIssue() runs updateTargets() and removal of the accepted label concurrently with Promise.all; target-state restoration uses process.env.CRAFT_STATE_FILE_PATH, while label removal calls octokit.rest.issues.removeLabel({ ...publishRepo, issue_number, name: "accepted" }).updateTargets() and accepted-label removal share one Promise.all, updateIssue() rejects if either operation rejects, although the sibling operation may already have completed independently.src/modules/update-issue.js exports { updateIssue, transformIssueBody }; updateTargets() is not exported.