Comment on All Existing Open Issues #55
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: 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 | |
}); | |
} |