Skip to content

Commit

Permalink
cascading-runs: make looking for the /git-artifacts comment more ro…
Browse files Browse the repository at this point in the history
…bust

In my tests, it seems that the trailing newline may be shown when
searching without any token, and trimmed when searching with token.

That makes no sense, but let's guard against this condition anyway.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Nov 14, 2023
1 parent c456fac commit b7f1171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GitForWindowsHelper/issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getGitArtifactsCommentID = async (context, token, owner, repo, headSHA) =>
})
const items = answer.items.filter(item =>
item.text_matches.length === 1
&& item.text_matches[0].fragment === '/git-artifacts\n\nThe tag-git workflow run was started\n'
&& item.text_matches[0].fragment.trim() === '/git-artifacts\n\nThe tag-git workflow run was started'
)
return items.length === 1 && items[0].text_matches[0].object_url.replace(/^.*\/(\d+)$/, '$1')
}
Expand Down

0 comments on commit b7f1171

Please sign in to comment.