mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-07-01 22:49:06 +00:00
perf: update issue workflow
This commit is contained in:
34
.github/workflows/issue-close-require.yml
vendored
34
.github/workflows/issue-close-require.yml
vendored
@@ -4,17 +4,31 @@ on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-close-require:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: need reproduce
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
labels: '⏳ Pending feedback'
|
||||
inactive-day: 30
|
||||
body: |
|
||||
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。
|
||||
- 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
|
||||
|
||||
15
.github/workflows/issue-close.yml
vendored
15
.github/workflows/issue-close.yml
vendored
@@ -4,13 +4,18 @@ on:
|
||||
issues:
|
||||
types: [closed]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-close-remove-labels:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
steps:
|
||||
- name: Remove labels
|
||||
uses: actions-cool/issues-helper@v2
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: '🔔 Pending processing,⏳ Pending feedback'
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--remove-label "🔔 Pending processing" \
|
||||
--remove-label "⏳ Pending feedback"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
14
.github/workflows/issue-open.yml
vendored
14
.github/workflows/issue-open.yml
vendored
@@ -4,13 +4,17 @@ on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
issue-open-add-labels:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
steps:
|
||||
- name: Add labels
|
||||
uses: actions-cool/issues-helper@v2
|
||||
if: ${{ !github.event.issue.pull_request }}
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: '🔔 Pending processing'
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--add-label "🔔 Pending processing"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
Reference in New Issue
Block a user