Skip to content

Issue Close Require #873

Issue Close Require

Issue Close Require #873

name: Issue Close Require
on:
schedule:
- cron: '0 0 * * *'
jobs:
issue-close-require:
permissions:
issues: write
runs-on: ubuntu-latest
if: github.repository == 'module-federation/core'
steps:
- name: need reproduction
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
BODY: |
As the issue was labelled with `need reproduction`, but no response in 5 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions. For background, see [Why reproductions are required](https://antfu.me/posts/why-reproductions-are-required).
由于该 issue 被标记为 "需要重现",但在 5 天内没有回应,因此该 issue 将被关闭。如果你有任何进一步的问题,请随时发表评论并重新打开该 issue。背景请参考 [为什么需要最小重现](https://antfu.me/posts/why-reproductions-are-required-zh)。
run: |
cutoff="$(date -u -d '5 days ago' +%F)"
query="repo:${REPO} is:issue is:open label:\"need reproduction\" updated:<${cutoff}"
issue_numbers="$(gh api --method GET --paginate search/issues -f q="$query" --jq '.items[].number')"
if [ -z "$issue_numbers" ]; then
echo "No stale issues found."
exit 0
fi
while IFS= read -r issue_number; do
if [ -z "$issue_number" ]; then
continue
fi
gh issue close "${issue_number}" --repo "${REPO}" --comment "$BODY"
done <<< "$issue_numbers"