first-time-contributor.yml•1.64 kB
name: First-time Contributor Welcome
on:
pull_request_target:
types: [opened]
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- name: Check if first-time contributor
uses: actions/github-script@v7
with:
script: |
const { data: pullRequests } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
creator: context.payload.pull_request.user.login,
state: 'all'
});
const isFirstTime = pullRequests.length === 1;
if (isFirstTime) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: `## Welcome! 👋
Thank you for your first contribution to pref-editor-mcp-server!
### Before we review your PR, please ensure:
- [ ] You've read our [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/CONTRIBUTING.md) guidelines
- [ ] Your PR title follows the required format: \`feat:\`, \`fix:\`, or \`BREAKING:\`
- [ ] You've run \`npm run verify\` locally and all checks pass
- [ ] You understand this project is licensed under Apache 2.0
### Need help?
- Check [DEV.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/DEV.md) for development setup
- Feel free to ask questions in this PR
- Our automated CI will help catch any issues
Thanks for contributing! 🚀`
});
}`