fix: complete lesson lint cleanup #478
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: Thank Merged PR Contributor | |
| on: | |
| pull_request_target: | |
| types: [closed] | |
| permissions: | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| thank: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Thank contributor | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PR_NUM: ${{ github.event.pull_request.number }} | |
| AUTHOR: ${{ github.event.pull_request.user.login }} | |
| TITLE: ${{ github.event.pull_request.title }} | |
| ADDITIONS: ${{ github.event.pull_request.additions }} | |
| FILES: ${{ github.event.pull_request.changed_files }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| # Skip bot accounts | |
| if echo "$AUTHOR" | grep -qiE "bot|dependabot|actions|github"; then | |
| echo "Skipping bot account: $AUTHOR" | |
| exit 0 | |
| fi | |
| # Check if this is the author's first merged PR | |
| PREVIOUS=$(gh pr list --repo "$REPO" --author "$AUTHOR" --state merged --limit 10 --json number --jq 'length' 2>/dev/null || echo "0") | |
| # Choose message based on first-time vs returning | |
| if [ "$PREVIOUS" -le 1 ]; then | |
| # First-time contributor | |
| BODY="🎉 **Merged! Welcome, @${AUTHOR}.** | |
| **${TITLE}** (+${ADDITIONS} lines, ${FILES} files) | |
| Thanks for contributing to MisakaNet. Your work is now part of the knowledge base. | |
| Quick question — did any MisakaNet lesson, doc, or search result help you while working on this PR? | |
| If yes, we'd love to know which one. If not, we'd love to know what would help. | |
| → [Share feedback](https://github.com/Ikalus1988/MisakaNet/issues/new?template=lesson-feedback.yml) | |
| No pressure. Even a one-line answer helps us improve. ⚡" | |
| else | |
| # Returning contributor | |
| BODY="✅ **Merged!** Thanks again, @${AUTHOR}. | |
| **${TITLE}** (+${ADDITIONS} lines, ${FILES} files) | |
| Quick question — did any MisakaNet lesson help you this time? | |
| → [Share feedback](https://github.com/Ikalus1988/MisakaNet/issues/new?template=lesson-feedback.yml) | |
| No need to reply if nothing comes to mind. ⚡" | |
| fi | |
| gh pr comment "$PR_NUM" --repo "$REPO" --body "$BODY" | |
| echo "Thanked @$AUTHOR on PR #$PR_NUM" |