Skip to content
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

1438 Fix issue assignment comment GHA #1465

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/isssue-assigned.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/issue-assigned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Issue Assignment Comment

on:
issues:
types: [assigned]

jobs:
issue-assignment-comment:
runs-on: ubuntu-latest

steps:
- name: Issue assignment comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const assignees = context.payload.issue.assignees;

for (const assignee of assignees) {
const assigneeUsername = `@${assignee.login}`;

const commentBody = `Hey ${assigneeUsername}! Thanks for taking this issue.

To help keep everyone in the loop, please comment your Estimated Time to Completion (ETC) below!

Thanks again!
`;

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentBody,
});
}