diff --git a/.github/workflows/auto-comment.yml b/.github/workflows/auto-comment.yml index 86f7271341..560872e39c 100644 --- a/.github/workflows/auto-comment.yml +++ b/.github/workflows/auto-comment.yml @@ -32,15 +32,16 @@ jobs: }); - name: Comment on PR - if: github.event_name == 'pull_request' - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | +        if: github.event_name == 'pull_request' +        uses: actions/github-script@v7 +        with: +          github-token: ${{ secrets.GITHUB_TOKEN }} +          script: | +            const prNumber = context.payload.pull_request.number; const username = context.payload.pull_request.user.login; - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `@${username} Please Star ⭐️ the repo to earn '**_hacktober-accepted_**' label for the event.` - }); +            await github.rest.issues.createComment({ +              issue_number: prNumber, +              owner: context.repo.owner, +              repo: context.repo.repo, +              body: `@${username} Please Star ⭐️ the repo to earn '**_hacktober-accepted_**' label for the event.` +            });