Dashboard › publish › Distillation
f109fc19-ceae-427a-b850-690aac30a666["lore_tm_v1_q7_aDiYpdNjvFT8QT-1NQ5SWawK_vMAm6xWZ0QEhDS0","lore_tm_v1_lrbkFdk7o4V3T2yJpf7XFTrGXG27XrzHmdFssT2xv5k","lore_tm_v1_UerPuirA6b6JW_wBm-MbbkGcvHRXvB6tXNoKoZVxkx8"]
You must be an org admin or have the actions secrets fine-grained permission. The API operation requires the admin:org scope; GitHub suggested gh auth refresh -h github.com -s admin:org./home/byk/Code/getsentry/publish/src/modules/update-issue.js is 82 lines and exports updateIssue and transformIssueBody; it imports TARGETS_SECTION_PARSER_REGEX and TARGETS_PARSER_REGEX from ./details-from-context.updateTargets() in src/modules/update-issue.js uses the Craft state path ${process.env.GITHUB_WORKSPACE}/__repo__/.craft-publish-${version}.json; if that file does not exist, it returns without retrieving or updating the issue.updateTargets() concurrently retrieves the publish issue through octokit.rest.issues.get() and reads/parses the JSON state file as UTF-8, then replaces the issue body with transformIssueBody(craftState, issue.body) via octokit.rest.issues.update().transformIssueBody() updates checkbox states in the section matched by TARGETS_SECTION_PARSER_REGEX: each declared target becomes - [x] ${targetId} when craftState.published[targetId] is truthy and - [ ] ${targetId} otherwise. It tracks declared target IDs and appends every unlisted key from craftState.published with its corresponding checked or unchecked state.updateIssue() obtains publishRepo from context.repo and issue_number from context.payload.issue.number; it concurrently removes the accepted label and, only when inputs?.version is present, invokes updateTargets()./home/byk/Code/getsentry/publish/src/modules/__tests__/update-issue.js is 208 lines and uses Vitest with vi, describe, test, expect, beforeAll, beforeEach, and it.updateTargetsArgs fixture uses inputs: { repo: "sentry", version: "21.3.1" }, context.runId: "1234", publish repository { owner: "getsentry", repo: "publish" }, and issue number "211". The mocked Craft state is { published: { lol: true, hey: false, github: true } }.src/modules/__tests__/update-issue.js tests both Craft-state-file conditions with describe.each([false, true]); each condition expects exactly one fs.existsSync() call with ./__repo__/.craft-publish-21.3.1.json.restore publish state test expects one issue lookup with { issue_number: "211", owner: "getsentry", repo: "publish" }, one issue update, and an updated body containing - [x] github, - [ ] pypi, - [x] lol, and - [ ] hey.don't modify issue body test expects octokit.rest.issues.update not to be called.remove label test expects exactly one removeLabel() call with { owner: "getsentry", repo: "publish", issue_number: "211", name: "accepted" }.removes accepted without parsed publish inputs test calls updateIssue() with inputs: undefined; it expects no fs.existsSync(), issue-get, or issue-update calls, while still expecting removal of the accepted label from getsentry/publish issue "211".transformIssueBody test supplies published states "npm[@sentry/node]": true, "aws-lambda": true, github: false, and foo: true. It expects the existing targets to normalize to - [x] npm[@sentry/node], - [x] aws-lambda, and - [ ] github, followed by the newly appended - [x] foo, while preserving the surrounding issue content.