Skip to content

Commit

Permalink
add pause to wait for issue to post
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorFries committed Nov 6, 2024
1 parent 4930ed1 commit 157135b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/helpers/github-api/github-api-requests.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ export async function closeIssue(issue_number) {
* addComment('My Issue', 'An example comment');
*/
export async function addComment(issueTitle, issueComment) {
const issueNumber = await findIssueByTitle(issueTitle);
let issueNumber = await findIssueByTitle(issueTitle);
let counter = 1;

while ( typeof issueNumber !== 'number' && counter < 5){
setTimeout(() =>
console.log(`no issue with ${issueTitle} found, pausing...`), counter * 1000);
issueNumber = await findIssueByTitle(issueTitle);
counter++;
};

const request = await octokit.rest.issues.createComment({
owner: GITHUB_OWNER,
Expand Down

0 comments on commit 157135b

Please sign in to comment.