Some problem #3
This file contains 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: "Assign issue to creator on specific comment" | |
on: | |
issue_comment: | |
types: [created] | |
jobs: | |
assign: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Assign issue to author if comment is $done | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const issue = context.issue; | |
const comment_id = context.payload.comment.id; | |
const comment_body = context.payload.comment.body; | |
const creator = context.payload.issue.user.login; | |
if (comment_body.trim() === "$test") { | |
github.rest.issues.addAssignees({ | |
owner: issue.owner, | |
repo: issue.repo, | |
issue_number: issue.number, | |
assignees: [creator] | |
}) | |
} | |
github-token: ${{secrets.GITHUB_TOKEN}} |