mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
Migrate issue label/close workflows to native gh scripts with explicit permissions, and update README cloud/AI coverage plus typo fixes.
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Issue Check Inactive
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *"
|
|
|
|
permissions:
|
|
issues: write
|
|
|
|
jobs:
|
|
issue-check-inactive:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Label inactive issues as stale
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
INACTIVE_DAY: "30"
|
|
INACTIVE_LABEL: "stale"
|
|
EXCLUDE_LABEL: "announcement"
|
|
run: |
|
|
set -euo pipefail
|
|
cutoff="$(date -u -d "${INACTIVE_DAY} days ago" +%Y-%m-%dT%H:%M:%SZ)"
|
|
|
|
gh issue list \
|
|
--repo "${{ github.repository }}" \
|
|
--state open \
|
|
--limit 1000 \
|
|
--json number,labels,updatedAt \
|
|
| jq -c \
|
|
--arg cutoff "$cutoff" \
|
|
--arg inactive "$INACTIVE_LABEL" \
|
|
--arg exclude "$EXCLUDE_LABEL" \
|
|
'
|
|
.[]
|
|
| select(.updatedAt < $cutoff)
|
|
| select([.labels[].name] | index($exclude) | not)
|
|
| select([.labels[].name] | index($inactive) | not)
|
|
' \
|
|
| while IFS= read -r issue; do
|
|
number="$(echo "$issue" | jq -r .number)"
|
|
echo "Marking issue #${number} as ${INACTIVE_LABEL}"
|
|
gh issue edit "$number" \
|
|
--repo "${{ github.repository }}" \
|
|
--add-label "$INACTIVE_LABEL"
|
|
done
|