-
Notifications
You must be signed in to change notification settings - Fork 48
68 lines (62 loc) · 2.56 KB
/
community-issue-comment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -----------------------------------------------------------------------------
# GitHub Actions Workflow: Issue Comments
# Description: Post issue comments
# Jobs:
# - Assigned comment
# - Stale label comment
# -----------------------------------------------------------------------------
name: Issue Comment Workflows
on:
workflow_run:
workflows: ['Label Stale Contributions']
types:
- completed
issues:
types:
- assigned
- labeled
jobs:
# Job: Assigned issue comment
# Trigger: Issues are assigned
# Returns: Posts comment tagging assignee and helpful message
assigned-comment:
if: github.event.action == 'assigned'
runs-on: ubuntu-latest
steps:
- name: Post assignee issue comment
id: assigned-comment
uses: actions/github-script@v7 # https://github.com/actions/github-script
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `Thank you @${context.payload.issue.assignee.login} you have been assigned this issue!
**Please follow the directions in our [Contributing Guide](https://github.com/chaynHQ/.github/blob/main/docs/CONTRIBUTING.md). We look forward to reviewing your pull request. ✨**
---
Support Chayn's mission? ⭐ Please star this repo to help us find more contributors like you!
Learn more about Chayn's impact [here](https://github.com/chaynHQ/.github/blob/main/profile/README.md). 🌸`
})
# Job: Stale label comment
# Triggers:
# Labeled as stale by maintainer
# 'Label Stale Contributions' workflow runs
# Returns: Posts warning comment tagging assignee
stale-label-comment:
if: github.event.action == 'labeled' && github.event.label.name == 'stale'
runs-on: ubuntu-latest
steps:
- name: Post stale issue comment
id: stale-label-comment
uses: actions/github-script@v7 # https://github.com/actions/github-script
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `@${context.payload.issue.assignee.login} As per Chayn policy, after 30 days of inactivity, we will be unassigning this issue. Please comment to stay assigned.`
})