Skip to content

Commit d84097b

Browse files
authored
Actions: comments & stale management (#466)
Updated stale workflow to include PRs Upgraded assignee issue comment with markdown using github/script New first interaction workflow for contributors who open PRs without being assigned issues
1 parent 2c7ea2e commit d84097b

5 files changed

+94
-58
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This workflow comments on PRs opened by first time contributors.
2+
# Reminds first timer contributors to associate their PR with an issue and follow the guidelines.
3+
# See for more info: https://github.com/actions/first-interaction
4+
5+
name: First Interaction PR Comment
6+
7+
on: [pull_request]
8+
9+
jobs:
10+
greeting:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/first-interaction@v1
14+
with:
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
pr-message: "First time contributors to Chayn: Please make sure that this PR is linked to an issue you are assigned! We will not merge contributor PRs without a linked assigned issue. Please ask to be assigned an existing issue or create your own before opening a PR. Read our Contributing Guidelines in the CONTRIBUTING.md file for more details. Thank you for your contribution!"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow handles issue comments.
2+
3+
name: Issue Assignee Comment
4+
5+
on:
6+
issues:
7+
types:
8+
- assigned
9+
- labeled
10+
11+
jobs:
12+
# When issues are assigned, a comment is posted
13+
# Tags the assignee with links to helpful resources
14+
# See for more info: https://github.com/actions/github-script
15+
assigned-comment:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Post assignee issue comment
19+
id: assigned-comment
20+
uses: actions/github-script@v7
21+
with:
22+
github-token: ${{secrets.GITHUB_TOKEN}}
23+
script: |
24+
github.rest.issues.createComment({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
issue_number: context.payload.issue.number,
28+
body: `Thank you @${context.payload.issue.assignee.login} you have been assigned this issue!
29+
**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 shortly ✨**
30+
31+
---
32+
33+
Support Chayn's mission? ⭐ Please star this repo to help us find more contributors like you!
34+
Learn more about Chayn [here](https://linktr.ee/chayn) and [explore our projects](https://org.chayn.co/projects). 🌸`
35+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow labels stale issues and PRs after 30 days of inactivity.
2+
# Stale PRs are closed after 1 week of inactivity after labeled stale.
3+
# See for more info: https://github.com/actions/stale
4+
5+
name: Mark Stale Contributions
6+
7+
on:
8+
# Enable manual run from the Actions tab so workflow can be run at any time
9+
workflow_dispatch:
10+
# Scheduled to run at 12:00 on every Monday
11+
schedule:
12+
- cron: "0 0 * * MON"
13+
14+
jobs:
15+
stale:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
issues: write
19+
pull-requests: write
20+
21+
steps:
22+
- uses: actions/stale@v9
23+
with:
24+
repo-token: ${{ secrets.GITHUB_TOKEN }}
25+
stale-label: "stale"
26+
days-before-stale: 30
27+
# disables closing issues
28+
days-before-issue-close: -1
29+
# close pr after 1 week no updates after stale warning
30+
days-before-pr-close: 7
31+
# only scan assigned issues
32+
include-only-assigned: true
33+
# ignore issues assigned to staff and bots
34+
exempt-assignees: "kyleecodes, swetha-charles, eleanorreem, annarhughes, tarebyte, dependabot[bot], dependabot, github-actions[bot], github-actions"
35+
# disable removing stale label due to irrelevant activity (like branch updates)
36+
remove-stale-when-updated: false
37+
# exempt dependabot prs from going stale
38+
exempt-pr-labels: dependencies
39+
# disable counting irrelevant activity (branch updates) towards day counter on prs.
40+
ignore-pr-updates: true
41+
stale-pr-message: "As per Chayn policy, after 30 days of inactivity, we will close this PR."
42+
close-pr-message: "This PR has been closed due to inactivity."
43+
stale-issue-message: "As per Chayn policy, after 30 days of inactivity, we will be unassigning this issue. Please comment to stay assigned."

.github/workflows/new-assignee-comment.yml

-23
This file was deleted.

.github/workflows/stale-issue-management.yml

-35
This file was deleted.

0 commit comments

Comments
 (0)