name: Check Onboarding KCL on: pull_request: types: [opened, synchronize] paths: - 'src/lib/exampleKcl.ts' permissions: contents: read issues: write pull-requests: write jobs: comment: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Comment on PR uses: actions/github-script@v7 with: script: | const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.'; const issue_number = context.payload.pull_request.number; const owner = context.repo.owner; const repo = context.repo.repo; const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number }); const commentExists = comments.some(comment => comment.body === message); if (!commentExists) { // Post a comment on the PR await github.rest.issues.createComment({ owner, repo, issue_number, body: message, }); }