-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate Labeling of Issues Based on Comments from Non-Core Members #8847
Comments
@aravindm4 lets just add the tag, lets not make the removal automatic. name: Notify Core Team on Non-Core Questions
on:
issue_comment:
types: [created]
jobs:
notify_core_team:
runs-on: ubuntu-latest
steps:
- name: Check if commenter is non-core member
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const coreMembers = ['coreMember1', 'coreMember2']; // Define core members
const commenter = context.payload.comment.user.login;
if (!coreMembers.includes(commenter)) {
return commenter; // Proceed if not core member
}
- name: Check if comment is a question
id: check_question
run: |
echo "${{ github.event.comment.body }}" | grep -Eq "(\?|what|how|why|when|who)"
- name: Notify core team
if: ${{ steps.check_question.outcome == 'success' }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"A non-core member posted a question: https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}"}' ${{ secrets.SLACK_WEBHOOK }}
- name: Add question label (optional)
if: ${{ steps.check_question.outcome == 'success' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: ['question'],
});
Something like this with options for questions and core configurable via actions env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Currently, there is no way to track issues with unresolved comments. Contributors, interns, or anyone other than core team members may have shared a comment that requires action from the core team, but it might be missed, causing the issue to stall.
Describe the solution you'd like
To identify such cases, a label can be automatically added to the issue whenever someone other than a core team member comments.
Feature Requirements:
The text was updated successfully, but these errors were encountered: