Skip to content

Commit bbbcdbb

Browse files
committed
fix: wrap standalone await in async IIFE in workflows
1 parent 16e36ca commit bbbcdbb

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

.github/workflows/issue-create-automate-message.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ jobs:
1515
uses: actions/github-script@v6
1616
with:
1717
script: |
18-
const issueNumber = context.issue.number;
19-
const commentBody1 = `### Thank you for raising this issue!\n We'll review it as soon as possible. We truly appreciate your contributions! ✨\n\n> Meanwhile make sure you've visited the README.md, CONTRIBUTING.md, and CODE_OF_CONDUCT.md before creating a PR for this. Also, please do NOT create a PR until this issue has been assigned to you. 😊`;
20-
await github.rest.issues.createComment({
21-
owner: context.repo.owner,
22-
repo: context.repo.repo,
23-
issue_number: issueNumber,
24-
body: commentBody1
25-
});
26-
console.log('Comment added successfully.');
18+
(async () => {
19+
const issueNumber = context.issue.number;
20+
const commentBody1 = `### Thank you for raising this issue!\n We'll review it as soon as possible. We truly appreciate your contributions! ✨\n\n> Meanwhile make sure you've visited the README.md, CONTRIBUTING.md, and CODE_OF_CONDUCT.md before creating a PR for this. Also, please do NOT create a PR until this issue has been assigned to you. 😊`;
21+
await github.rest.issues.createComment({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
issue_number: issueNumber,
25+
body: commentBody1
26+
});
27+
console.log('Comment added successfully.');
28+
})();

.github/workflows/pr-create-automate-message.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ jobs:
1616
uses: actions/github-script@v6
1717
with:
1818
script: |
19-
const prNumber = context.issue.number;
20-
const commentBody = `### Thanks for creating a PR for your Issue! ☺️\n\nWe'll review it as soon as possible.\nIn the meantime, please double-check the **file changes** and ensure that **all commits** are accurate.\n\nIf there are any **unresolved review comments**, feel free to resolve them. 🙌🏼`;
21-
await github.rest.issues.createComment({
22-
owner: context.repo.owner,
23-
repo: context.repo.repo,
24-
issue_number: prNumber,
25-
body: commentBody
26-
});
27-
console.log('Comment added successfully.');
19+
(async () => {
20+
const prNumber = context.issue.number;
21+
const commentBody = `### Thanks for creating a PR for your Issue! ☺️\n\nWe'll review it as soon as possible.\nIn the meantime, please double-check the **file changes** and ensure that **all commits** are accurate.\n\nIf there are any **unresolved review comments**, feel free to resolve them. 🙌🏼`;
22+
await github.rest.issues.createComment({
23+
owner: context.repo.owner,
24+
repo: context.repo.repo,
25+
issue_number: prNumber,
26+
body: commentBody
27+
});
28+
console.log('Comment added successfully.');
29+
})();

0 commit comments

Comments
 (0)