feat: kafka driver change #2992
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation Check | |
| on: | |
| pull_request: | |
| types: [ opened, edited, synchronize ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-documentation: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate Documentation | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const { body } = context.payload.pull_request; | |
| // If N/A is checked, we're done | |
| if (/-\s*\[\s*[xX]\s*\]\s*N\/A/.test(body)) return; | |
| // Check for valid documentation link in the Documentation Link line | |
| const docLine = body.match(/-\s*\[\s*[xX]\s*\]\s*Documentation Link:[^\n]*/i); | |
| if (!docLine) { | |
| core.setFailed( | |
| 'Documentation Required: Please either check "Documentation Link" and provide a valid link, or check "N/A" for bug fixes, refactors, or test changes.' | |
| ); | |
| return; | |
| } | |
| const validLinkPatterns = [ | |
| /https:\/\/olake\.io\/docs[^\s)]*/, | |
| /https:\/\/github\.com\/datazip-inc\/olake-docs[^\s)]*/, | |
| /\[[^\]]*\]\([^)]*README[^)]*\)/i | |
| ]; | |
| const hasValidLink = validLinkPatterns.some(pattern => pattern.test(docLine[0])); | |
| if (!hasValidLink) { | |
| core.setFailed( | |
| 'Documentation Required: Please provide a valid documentation link next to the checked "Documentation Link" option. Valid sources: README files, olake.io/docs, or olake-docs repository.' | |
| ); | |
| } |