Files
jumpserver/.github/workflows/issue-close-require.yml
2026-06-11 14:17:43 +08:00

35 lines
1.2 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Issue Close Require
on:
schedule:
- cron: "0 0 * * *"
permissions:
issues: write
jobs:
issue-close-require:
runs-on: ubuntu-latest
steps:
- name: Close inactive issues pending feedback
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
set -euo pipefail
cutoff="$(date -u -d '30 days ago' '+%Y-%m-%d')"
query="repo:${GH_REPO} is:issue is:open label:\"⏳ Pending feedback\" updated:<${cutoff}"
printf '%s\n' \
"You haven't provided feedback for over 30 days." \
"We will close this issue. If you have any further needs, you can reopen it or submit a new issue." \
"您超过 30 天未反馈信息,我们将关闭该 issue如有需求您可以重新打开或者提交新的 issue。" \
> "${RUNNER_TEMP}/close-comment.md"
gh api --method GET --paginate /search/issues -f q="${query}" -f per_page=100 --jq '.items[].number' |
while read -r issue_number; do
gh issue comment "${issue_number}" --repo "${GH_REPO}" --body-file "${RUNNER_TEMP}/close-comment.md"
gh issue close "${issue_number}" --repo "${GH_REPO}"
done