Skip to content

Commit

Permalink
Patch Workflow on Stale Checking (#482)
Browse files Browse the repository at this point in the history
* Update stale.yml

* Create add-new-comment-on-stale

* Update and rename stale.yml to stale-labeler.yml

* Update add-new-comment-on-stale

* Rename add-new-comment-on-stale to add-new-comment-on-stale.yml
  • Loading branch information
sabilmakbar authored Mar 3, 2024
1 parent 34aca8f commit c6214c9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/add-new-comment-on-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
issues:
types:
- labeled

jobs:
add-comment-on-staled-issue:
if: github.event.label.name == "staled-issue"
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- name: Remind assignee on staled Issue
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body: "Hi @${{github.event.issue.assignee.login}}, may I know if you are still working on this issue? Please let @holylovenia @SamuelCahyawijaya @sabilmakbar know if you need any help."

add-comment-on-staled-pr:
if: github.event.label.name == "need-fu-pr"
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- name: Remind assignee and author on staled PR
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{github.event.pull_request.number}}
body: "Hi @${{join(github.event.pull_request.assignees.*.login, ', @')}} & @${{github.event.pull_request.user.login}}, may I know if you are still working on this PR?"
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- cron: '20 1 * * *'

jobs:
stale:

stale_detection:
name: Detect Stale Issues/PR
runs-on: ubuntu-latest
permissions:
issues: write
Expand All @@ -22,8 +22,9 @@ jobs:
with:

repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "Hi @${{github.event.issue.assignee.login}}, may I know if you are still working on this issue? Please let @holylovenia @SamuelCahyawijaya @sabilmakbar know if you need any help."
stale-pr-message: "Hi @${{join(github.event.issue.assignees.*.login, ', @')}} & @${{github.event.issue.user.login}}, may I know if you are still working on this PR?"
# only labels the stale, the comment addition will be handled by another workflow
stale-issue-message: ""
stale-pr-message: ""
stale-issue-label: "staled-issue"
stale-pr-label: "need-fu-pr"
days-before-stale: 14
Expand Down

0 comments on commit c6214c9

Please sign in to comment.