Implementation of the base error system for gp-engine #1
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 New Contributor | |
| on: | |
| pull_request_target: | |
| types: [opened] | |
| jobs: | |
| welcome: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.user.type != 'Bot' | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Welcome First-Time Contributor | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const creator = context.payload.pull_request.user.login; | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const prNumber = context.payload.pull_request.number; | |
| const { data: searchResult } = await github.rest.search.issuesAndPullRequests({ | |
| q: `is:pr author:${creator} repo:${owner}/${repo}` | |
| }); | |
| if (searchResult.total_count === 1) { | |
| const welcomeMessage = `Welcome to **Graphical Playground (${repo})**, @${creator}! 🎉\n\n` + | |
| `We are thrilled to have you here and appreciate you opening your first Pull Request! \n\n` + | |
| `### What's next?\n` + | |
| `- Please ensure your code follows our formatting guidelines.\n` + | |
| `- If you haven't already, take a quick look at our [Contributing Guidelines](CONTRIBUTING.md).\n` + | |
| `- A maintainer will review your code shortly.\n\n` + | |
| `Thanks again for your contribution!`; | |
| await github.rest.issues.createComment({ | |
| owner: owner, | |
| repo: repo, | |
| issue_number: prNumber, | |
| body: welcomeMessage | |
| }); | |
| } |