Skip to content

Commit

Permalink
Actions: community cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleecodes committed Nov 6, 2024
1 parent b856372 commit e287e4a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 256 deletions.
54 changes: 33 additions & 21 deletions .github/workflows/community-issue-comment.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,62 @@
# This workflow handles issue comments.
# See for more info: https://github.com/actions/github-script
# -----------------------------------------------------------------------------
# GitHub Actions Workflow: Issue Comments
# Description: Post issue comments
# Jobs:
# - Assigned comment
# - Stale label comment
# -----------------------------------------------------------------------------

name: Issue Comments
name: Issue Comment Workflows

on:
workflow_run:
workflows: ["Label Stale Contributions"]
types:
- completed
issues:
types:
- assigned
- labeled

jobs:
# When issues are assigned, a comment is posted
# Tags the assignee with links to helpful resources
# 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
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 and our impact [here](https://github.com/chaynHQ/.github/blob/main/profile/README.md). 🌸`
})
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). 🌸`
})
# When issues are labeled as stale, a comment is posted.
# Tags the assignee with warning.
# Enables manual issue management in addition to community-stale-management.yml
# 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
uses: actions/github-script@v7 # https://github.com/actions/github-script
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/community-pr-labeler.yml

This file was deleted.

33 changes: 18 additions & 15 deletions .github/workflows/community-stale-management.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
# This workflow labels stale issues and PRs after 30 days of inactivity.
# Stale PRs are closed after 1 week of inactivity after labeled stale.
# See for more info: https://github.com/actions/stale
# -----------------------------------------------------------------------------
# GitHub Actions Workflow: Label Stale Contributions
# Description: Labels stale contributions
# Job: actions/stale
# -----------------------------------------------------------------------------

name: Mark Stale Contributions
name: Label Stale Contributions

on:
# Enable manual run from the Actions tab so workflow can be run at any time
workflow_dispatch:
workflow_dispatch: # enables manual trigger
# Scheduled to run at 12:00 on every Monday
schedule:
- cron: '0 0 * * MON'
- cron: "0 0 * * MON"

jobs:
# Trigger: Scheduled weekly
# Returns: labels issues and PRs with 'stale' after 30 days inactivity
# PRs: automated closing after 1 more week of inactivity
# Issues: requires manual closing by maintainers
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v9
- uses: actions/stale@v9 # https://github.com/actions/stale
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-label: 'stale'
stale-pr-label: 'stale'
stale-issue-label: "stale"
stale-pr-label: "stale"
days-before-stale: 30
# disables closing issues
days-before-issue-close: -1
days-before-pr-close: 7
# only scan assigned issues
include-only-assigned: true
# ignore issues assigned to staff and bots
exempt-assignees: 'kyleecodes, swetha-charles, eleanorreem, annarhughes, tarebyte, dependabot[bot], dependabot, github-actions[bot], github-actions'
exempt-assignees: "kyleecodes, swetha-charles, eleanorreem, annarhughes, tarebyte, dependabot[bot], dependabot, github-actions[bot], github-actions"
# disable removing stale label due to irrelevant activity (like branch updates)
remove-stale-when-updated: false
# exempt dependabot prs from going stale
exempt-pr-labels: dependencies
# disable counting irrelevant activity (branch updates) towards day counter on prs.
ignore-pr-updates: true
# messages skipped, instead handled by issue-comment.yml
stale-pr-message: ''
close-pr-message: ''
stale-issue-message: ''
# actions/stale does not enable tagging authors / assignees, so comments are handled by Issue Comments Workflows.
stale-pr-message: "As per Chayn policy, after 30 days of inactivity, we will close this PR in 7 days. Please comment or update to keep open."
61 changes: 0 additions & 61 deletions scripts/github-actions/checkPRLinkedIssue.js

This file was deleted.

109 changes: 0 additions & 109 deletions scripts/github-actions/prLabeling.js

This file was deleted.

20 changes: 0 additions & 20 deletions scripts/github-actions/utils/postGHComment.js

This file was deleted.

0 comments on commit e287e4a

Please sign in to comment.