Skip to content

Commit

Permalink
gogogo
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Mar 27, 2021
1 parent e38c792 commit 707d567
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/comment_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,36 @@ name: Comment on PR
on: pull_request

jobs:
diff:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
context.pulls.createReview({
pull_number: 14,
// Get a list of all issues created by the PR opener
// See: https://octokit.github.io/rest.js/#pagination
const creator = context.payload.sender.login
const opts = github.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all'
})
const issues = await github.paginate(opts)
for (const issue of issues) {
if (issue.number === context.issue.number) {
continue
}
if (issue.pull_request) {
return // Creator is already a contributor.
}
}
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'thanks'
event: 'REQUEST_CHANGES'
comments: [
{
path: gitlab/workflows/comment_pr.yml,
line: 1,
body: 'thanks'
}
body: 'Welcome, new contributor!'
})

0 comments on commit 707d567

Please sign in to comment.