feat: proactive weather ability #232
Workflow file for this run
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: Welcome | |
| on: | |
| pull_request_target: | |
| types: [opened] | |
| issues: | |
| types: [opened] | |
| jobs: | |
| welcome-pr: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request_target' | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const creator = context.payload.pull_request.user.login; | |
| const { data: prs } = await github.rest.pulls.list({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: 'all', | |
| creator: creator | |
| }); | |
| if (prs.length === 1) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| body: `π Welcome @${creator}! Thanks for your first contribution to OpenHome Abilities!\n\nA maintainer will review your PR shortly. While you wait:\n- β Star the repo if you haven't already\n- π¬ Join our [Discord](https://discord.gg/openhome)\n- π Check the [Contributing Guide](CONTRIBUTING.md)\n\nHere's what happens next:\n1. Our CI will validate your ability structure\n2. A reviewer will check your code\n3. Once approved, it'll be merged to \`dev\` and then to \`main\`\n\nThanks for building with OpenHome! π ` | |
| }); | |
| } | |
| welcome-issue: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'issues' | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const creator = context.payload.issue.user.login; | |
| const { data: issues } = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| creator: creator, | |
| state: 'all' | |
| }); | |
| if (issues.length === 1) { | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.issue.number, | |
| body: `π Thanks for opening your first issue, @${creator}! A maintainer will triage this shortly.\n\nIn the meantime, check if there's an existing [Discussion](https://github.com/openhome-dev/abilities/discussions) about this topic.` | |
| }); | |
| } |