[Phase 4] Migrate Landing Page and Global Features #717
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: Greet and Guide for Issues and PRs | |
| on: | |
| issues: | |
| types: [opened] | |
| pull_request: | |
| types: [opened] | |
| jobs: | |
| issue_greet_label_assign: | |
| if: github.event_name == 'issues' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add 'gssoc2025' label | |
| uses: actions-ecosystem/action-add-labels@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| labels: gssoc2025 | |
| - name: Assign issue opener | |
| uses: actions-ecosystem/action-add-assignees@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| assignees: ${{ github.event.issue.user.login }} | |
| - name: Greet and post guidelines for Issue | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const guidelines = ` | |
| π Hi @${{ github.event.issue.user.login }}! Thanks for opening this issue. | |
| **Contributor Guidelines** | |
| 1. Make sure your issue is clear and descriptive. | |
| 2. If you are reporting a bug, please include steps to reproduce it. | |
| 3. If suggesting a feature, explain why it would be beneficial. | |
| 4. Be respectful and constructive in your comments. | |
| 5. Review our [Contributing Guide](https://github.com/opensource-society/notesvault/blob/main/CONTRIBUTING.md) for more details. | |
| Good luck contributing to NotesVault! π | |
| `; | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: guidelines | |
| }); | |
| pr_greet_guidelines: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Greet and post guidelines for PR | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const guidelines = ` | |
| π Hi @${{ github.event.pull_request.user.login }}! Thanks for opening this pull request. | |
| **Contributor Guidelines** | |
| 1. Please make sure your PR description is clear and links to related issues if applicable. | |
| 2. Ensure your code follows our style guide and passes all tests. | |
| 3. Be respectful and constructive in your comments and reviews. | |
| 4. Review our [Contributing Guide](https://github.com/opensource-society/notesvault/blob/main/CONTRIBUTING.md) for more details. | |
| Good luck contributing to NotesVault! π | |
| `; | |
| await github.rest.issues.createComment({ | |
| issue_number: context.payload.pull_request.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: guidelines | |
| }) | |
| - name: Skip greeting for forked PRs | |
| if: github.event.pull_request.head.repo.full_name != github.repository | |
| run: | | |
| echo "Skipping comment: this pull request comes from a fork. GITHUB_TOKEN has limited permissions for forked PRs." |