feat: add ws-plugin and cron-plugin to official Motia plugins #1217
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: PR Validation | |
| on: | |
| pull_request_target: | |
| types: [opened, edited, synchronize, reopened] | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| statuses: write | |
| jobs: | |
| validate-title: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate PR Title | |
| uses: amannn/action-semantic-pull-request@v5 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| types: | | |
| feat | |
| fix | |
| docs | |
| style | |
| refactor | |
| perf | |
| test | |
| build | |
| ci | |
| chore | |
| revert | |
| requireScope: false | |
| subjectPattern: ^(?![A-Z]).+$ | |
| subjectPatternError: | | |
| The subject "{subject}" found in the pull request title "{title}" | |
| didn't match the configured pattern. Please ensure that the subject | |
| doesn't start with an uppercase character. | |
| check-pr-size: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check PR Size | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const { additions, deletions } = pr; | |
| const totalChanges = additions + deletions; | |
| let label = 'size/XS'; | |
| let comment = ''; | |
| if (totalChanges > 1000) { | |
| label = 'size/XL'; | |
| comment = '⚠️ This PR is quite large (>1000 lines). Consider splitting it into smaller PRs for easier review.'; | |
| } else if (totalChanges > 500) { | |
| label = 'size/L'; | |
| comment = '📦 This PR is large (>500 lines). Please ensure it has been properly tested.'; | |
| } else if (totalChanges > 100) { | |
| label = 'size/M'; | |
| } else if (totalChanges > 30) { | |
| label = 'size/S'; | |
| } | |
| // Add size label | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| labels: [label] | |
| }); | |
| // Add comment for large PRs | |
| if (comment) { | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number | |
| }); | |
| const botComment = comments.data.find(c => | |
| c.user.type === 'Bot' && c.body.includes('PR is') | |
| ); | |
| if (!botComment) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| body: comment | |
| }); | |
| } | |
| } | |
| welcome-contributor: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' | |
| steps: | |
| - name: Welcome First Time Contributor | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const pr = context.payload.pull_request; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| body: `👋 Welcome @${pr.user.login}! Thank you for your first contribution to Motia! | |
| Our maintainers will review your PR shortly. In the meantime, please ensure: | |
| - [ ] Your PR follows our contribution guidelines | |
| - [ ] All tests are passing | |
| - [ ] The PR title follows conventional commits format | |
| If you have any questions, feel free to ask in this PR or join our community discussions!` | |
| }); | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: pr.number, | |
| labels: ['first-time-contributor'] | |
| }); |