Skip to content

Commit 8c3d961

Browse files
authored
Merge pull request #2376 from rushmash91/main
Create Github issue response action
2 parents 14b5a5d + fb60126 commit 8c3d961

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/issue-response.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Issue Responder
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
add-sla-comment:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Add Comment
15+
uses: actions/github-script@v6
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
script: |
19+
const issueNumber = context.issue.number;
20+
const owner = context.repo.owner;
21+
const repo = context.repo.repo;
22+
23+
// Get the username of the issue opener
24+
const username = context.payload.issue.user.login;
25+
26+
// Your markdown message
27+
const slaMessage = `Hello @${username} 👋 Thank you for opening an issue in ACK! A maintainer will triage this issue soon.\n\nWe encourage community contributions, so if you're interested in tackling this yourself or suggesting a solution, please check out our [Contribution](https://github.com/aws-controllers-k8s/community/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://github.com/aws-controllers-k8s/community/blob/main/CODE_OF_CONDUCT.md) guidelines.\n\nYou can find more information about ACK on our [website](https://aws-controllers-k8s.github.io/community/).`;
28+
29+
// Create the comment on the opened issue
30+
await github.rest.issues.createComment({
31+
owner: owner,
32+
repo: repo,
33+
issue_number: issueNumber,
34+
body: slaMessage
35+
});

0 commit comments

Comments
 (0)