Fix code review feedback - remove unused variable #24
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 Contributors | ||
| on: | ||
| issues: | ||
| types: [opened] | ||
| pull_request_target: | ||
| types: [opened] | ||
| jobs: | ||
| welcome: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Welcome first-time contributors | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const isIssue = context.eventName === 'issues'; | ||
| const number = context.issue.number; | ||
| // Get all issues/PRs by this author | ||
| const { data: items } = isIssue | ||
| ? await github.rest.issues.listForRepo({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| creator: context.actor, | ||
| state: 'all' | ||
| }) | ||
| : await github.rest.pulls.list({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| state: 'all' | ||
| }); | ||
| // Check if this is the first contribution | ||
| const isFirstTime = items.length === 1; | ||
| if (isFirstTime) { | ||
| const message = isIssue | ||
| ? `👋 **Welcome @${context.actor}!** | ||
| Thank you for opening your first issue in the docx_viewer package! | ||
| We appreciate you taking the time to report this. A maintainer will review your issue soon. | ||
| Meanwhile, please make sure you've provided: | ||
| - ✅ Clear description of the issue | ||
| - ✅ Steps to reproduce | ||
| - ✅ Flutter & Dart versions | ||
| - ✅ Platform(s) affected | ||
| Feel free to join our [discussions](https://github.com/${context.repo.owner}/${context.repo.repo}/discussions) if you have questions!` | ||
| : `🎉 **Congratulations @${context.actor}!** | ||
| Thank you for opening your first pull request! We're excited to review your contribution. | ||
| **What happens next?** | ||
| - ✅ CI checks will run automatically | ||
| - 📊 Coverage and lint reports will be posted | ||
| - 👀 A maintainer will review your changes | ||
| - 💬 We may suggest some changes or ask questions | ||
| **Tips:** | ||
| - Make sure all CI checks pass | ||
| - Keep your branch up to date with main | ||
| - Be patient - reviews may take a few days | ||
| Thank you for contributing to docx_viewer! 🚀`; | ||
| if (isIssue) { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: number, | ||
| body: message | ||
| }); | ||
| } else { | ||
| await github.rest.pulls.createReview({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: number, | ||
| body: message, | ||
| event: 'COMMENT' | ||
| }); | ||
| } | ||
| } | ||