mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-07-02 15:08:22 +00:00
feat: merge dev custom
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 }}
|
||||
|
||||
47
.github/workflows/issue-comment.yml
vendored
47
.github/workflows/issue-comment.yml
vendored
@@ -7,19 +7,23 @@ name: Add issues workflow labels
|
||||
jobs:
|
||||
add-label-if-is-author:
|
||||
runs-on: ubuntu-latest
|
||||
if: (github.event.issue.user.id == github.event.comment.user.id) && !github.event.issue.pull_request && (github.event.issue.state == 'open')
|
||||
steps:
|
||||
- name: Add require handle label
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: '🔔 Pending processing'
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
- name: Remove require reply label
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: '⏳ Pending feedback'
|
||||
if: >
|
||||
(github.event.issue.user.id == github.event.comment.user.id) &&
|
||||
!github.event.issue.pull_request &&
|
||||
(github.event.issue.state == 'open')
|
||||
|
||||
steps:
|
||||
- name: Update labels
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--add-label "🔔 Pending processing" \
|
||||
--remove-label "⏳ Pending feedback"
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
add-label-if-is-member:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -50,16 +54,11 @@ jobs:
|
||||
- run: "echo comment user: '${{ github.event.comment.user.login }}'"
|
||||
- run: "echo contains? : '${{ contains(steps.member_names.outputs.data, github.event.comment.user.login) }}'"
|
||||
|
||||
- name: Add require replay label
|
||||
- name: Update labels
|
||||
if: contains(steps.member_names.outputs.data, github.event.comment.user.login)
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
labels: '⏳ Pending feedback'
|
||||
|
||||
- name: Remove require handle label
|
||||
if: contains(steps.member_names.outputs.data, github.event.comment.user.login)
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
labels: '🔔 Pending processing'
|
||||
run: |
|
||||
gh issue edit "${{ github.event.issue.number }}" \
|
||||
--add-label "⏳ Pending feedback" \
|
||||
--remove-label "🔔 Pending processing"
|
||||
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