* update github action * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) --------- Co-authored-by: 49fl <ircsurfer33@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
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,
 | 
						|
              });
 | 
						|
            } |