Skip to content

Comment on All Existing Open Issues #57

Comment on All Existing Open Issues

Comment on All Existing Open Issues #57

name: Comment on All Existing Open Issues
on:
issues:
types: [opened]
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
jobs:
comment-on-new-issue:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add Comment
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = github.context.payload.issue;
const issueCreator = issue.user.login;
const issueNumber = issue.number;
if (issue.title.toLowerCase().includes('add profile')) {
const commentMessage = `@all-contributors please add @${issueCreator} for review`;
github.rest.issues.createComment({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
issue_number: issueNumber,
body: commentMessage
});
}