Skip to content

Commit

Permalink
[#12480] Add a trigger for good first issues (#12560)
Browse files Browse the repository at this point in the history
* add good first issue yaml file

* remove error: context.issue is not a function

* github.issues.createComment in V4 becomes github.rest.issues.createComment in V5

* change message to be TEAMMATES specific

* resolve unexpected identifier issue

* put messages in seperate lines

* put messages in env variable

* put 2 whitespaces for a newline

* Add new lines between message

* Update comment-goodfirstissue.yml

* Add 2 lines

* add 3rd and 4th line

* put message in body variable

* change github actions version from v5 to v6

* Simplify good first issue yaml file

Co-authored-by: Zhao Jingjing <54243224+zhaojj2209@users.noreply.github.com>

---------

Co-authored-by: Zhao Jingjing <54243224+zhaojj2209@users.noreply.github.com>
  • Loading branch information
nagarajan-ck and zhaojj2209 committed Sep 16, 2023
1 parent ed3d5f0 commit ef058ca
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/comment-goodfirstissue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Comment on Good First Issue

on:
issues:
types:
- labeled

jobs:
comment:
if: github.event.label.name == 'good first issue'
runs-on: ubuntu-latest

steps:
- name: Add comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let body = `**Good First Issue - Notes for Contributors**
This issue is for **first-time contributors only**. If you are new to TEAMMATES, feel free to submit a PR for this issue.\n\n`
body += "*Please note that we allow only one `good first issue` per contributor.* If you have already made a prior contribution to TEAMMATES, you may wish to take a look at issues with the `help wanted` tag instead.\n\n"
body += "**We do not assign issues to contributors**. If you would like to pick up this issue, do post a comment below to express your interest and check if there is anyone else who is already working on the issue. We will do our best to reply and give you the go-ahead, but if we don't, feel free to submit a PR as long as there is no one else working on it.\n\n"
body += "**To get started**, do read through our [contributing guidelines](https://teammates.github.io/teammates/contributing-doc.html) carefully, and [set up a development environment on your local machine](https://teammates.github.io/teammates/setting-up.html) before making a PR.\n\n"
body += "If you need any clarifications on our [developer guide](https://teammates.github.io/teammates/index.html), or are facing issues that are not found in our [troubleshooting guide](https://teammates.github.io/teammates/troubleshooting-guide.html), please [post a message in our discussion forum](https://github.com/TEAMMATES/teammates/discussions)."
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
})

0 comments on commit ef058ca

Please sign in to comment.