@@ -396,11 +396,11 @@ crossReferences: timelineItems(first: 100, itemTypes: [CROSS_REFERENCED_EVENT])
396396 source {
397397 ... on Issue {
398398 id
399- bodyText
399+ body
400400 }
401401 ... on PullRequest {
402402 id
403- bodyText
403+ body
404404 }
405405 }
406406 }
@@ -423,7 +423,7 @@ query($id: ID!) {
423423
424424const UPDATE_ISSUE_BODY = `
425425mutation updateIssue($id: ID!, $body: String) {
426- addProjectCard (input: { id: $id, body: $body }) {
426+ updateIssue (input: { id: $id, body: $body }) {
427427 issue {
428428 id
429429 }
@@ -638,15 +638,17 @@ async function run() {
638638 // find all matching `- [ ] ...<url> or #<number>...` list items in each of
639639 // the cross referenced items and replace the [ ] with [x]
640640 const { node } = await api ( queries . GET_CROSSREFERENCED_ITEMS , { id : resource . node_id } ) ;
641+ core . info ( `found ${ node . crossReferences . nodes . length } references` ) ;
641642 node . crossReferences . nodes . forEach ( async ( { source : reference } ) => {
642643 if ( ! reference . id ) {
643644 // if the cross reference is to a non issue or PR, skip it
644645 return ;
645646 }
646647
647648 // if the body changes from checking boxes, push the changes back to GitHub
648- const updatedBody = reference . bodyText . replace ( regex , '$1- [x]$2' ) ;
649- if ( updatedBody !== reference . bodyText ) {
649+ const updatedBody = reference . body . replace ( regex , '$1- [x]$2' ) ;
650+ if ( updatedBody !== reference . body ) {
651+ core . info ( `updating ${ reference . id } ` ) ;
650652 await api ( queries . UPDATE_ISSUE_BODY , { id : reference . id , body : updatedBody } ) ;
651653 }
652654 } ) ;
0 commit comments