Skip to content

Commit

Permalink
Fixes the envvars in staleness checker
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <[email protected]>
  • Loading branch information
sighingnow committed Feb 27, 2024
1 parent 0d18bbd commit 0ab43dc
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:

env:
DEFAULT_ASSIGNEE: sighingnow
DAYS_BEFORE_ISSUE_CLOSE: 30
DAYS_BEFORE_PR_CLOSE: 60
DAYS_BEFORE_ISSUE_STALE: 7
DAYS_BEFORE_PR_STALE: 14

jobs:
stale:
Expand All @@ -32,10 +36,10 @@ jobs:
- uses: actions/stale@v9
id: stale
with:
days-before-issue-close: 30
days-before-pr-close: 60
days-before-issue-stale: 7
days-before-pr-stale: 14
days-before-issue-close: ${{ env.DAYS_BEFORE_ISSUE_CLOSE }}
days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }}
days-before-issue-stale: ${{ env.DAYS_BEFORE_ISSUE_STALE }}
days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }}
stale-issue-label: stale
stale-pr-label: stale
exempt-pr-labels: work-in-progress,requires-further-info
Expand All @@ -47,29 +51,30 @@ jobs:
env:
REPO: ${{ github.repository }}
STALED: ${{ steps.stale.outputs.staled-issues-prs }}
GH_TOKEN: ${{ github.token }}
run: |
for N in $(echo "$STALED" | jq -r ".[].number");
do
assignees=$(echo $(gh issue view $N -R $REPO --json assignees) | jq -r ".assignees[].login")
echo "Processing stable issue/pr $N, assignees: $assignees"
echo "Processing stale issue/pr $N, assignees: $assignees"
message=""
if [ -z "$assignees" ]; then
message="/cc"
for assignee in $DEFAULT_ASSIGNEE; do
message="$message @$assignee"
done
message="$message, this issus/pr is stable for a long time, please help to assign people to it"
message="$message, this issus/pr has had no activity for a long time, please help to review the status and assign people to work on it."
else
message="/cc"
for assignee in $assignees; do
message="$message @$assignee"
done
message="$message, this issus/pr is stable for a long time, could you folks help to review the status?"
message="$message, this issus/pr has had no activity for for a long time, could you folks help to review the status ?"
message="$message </br>"
message="$message If the issue/pr is waiting for further response from the reporter/author, please help to add the label \`requires-further-info\` to suppress further notification."
fi
echo "Commenting stable issue/pr $N, assignees: $assignees, message: $message"
echo "Commenting on stale issue/pr $N, assignees: $assignees, message: $message"
gh issue comment $N -R $REPO -b "$message"
done

0 comments on commit 0ab43dc

Please sign in to comment.