Skip to content

Commit bd39a3e

Browse files
Merge pull request #136 from euzghe/master
fix: resolve 'await used outside async function' in workflow scripts
2 parents ef12718 + 1860376 commit bd39a3e

3 files changed

Lines changed: 25 additions & 22 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+
})();

LocalMind-Frontend/src/shared/component/v1/LoginPage.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ const LoginPage: React.FC<LoginPageProps> = ({ apiService }) => {
1818
const [error, setError] = useState('')
1919
const navigate = useNavigate()
2020

21-
const handleLogin = async () => {
22-
try {
23-
setError('')
24-
const response = await apiService.login(email, password)
21+
const handleLogin = async () => {
22+
try {
23+
const response = await apiService.login(email, password)
2524

2625
if (response.success) {
2726
navigate('/dashboard')

0 commit comments

Comments
 (0)