Skip to content

Commit e67265c

Browse files
committed
change to updated, exclude closed
1 parent a0dcde5 commit e67265c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/discussions.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: |
2222
# Calculate date one year ago (365 days)
2323
ONE_YEAR_AGO=$(date -u -d "@$(($(date +%s) - 31536000))" '+%Y-%m-%dT%H:%M:%SZ')
24-
echo "Fetching discussions older than: $ONE_YEAR_AGO"
24+
echo "Fetching discussions not updated in over a year (before: $ONE_YEAR_AGO)"
2525
2626
# Fetch discussions using GitHub GraphQL API
2727
gh api graphql -f query='
@@ -46,10 +46,10 @@ jobs:
4646
}
4747
' -f owner="${{ github.repository_owner }}" -f repo="${{ github.event.repository.name }}" > discussions.json
4848
49-
# Parse and filter discussions older than 1 year
50-
echo "=== Discussions older than 1 year ==="
49+
# Parse and filter discussions not updated in over 1 year (exclude closed)
50+
echo "=== Open discussions not updated in over 1 year ==="
5151
jq -r --arg cutoff "$ONE_YEAR_AGO" '
5252
.data.repository.discussions.nodes[] |
53-
select(.updatedAt < $cutoff) |
54-
"Number: \(.number)\nTitle: \(.title)\nURL: \(.url)\nCreated: \(.createdAt)\nUpdated: \(.updatedAt)\nClosed: \(.closed)\nLocked: \(.locked)\n---"
53+
select(.updatedAt < $cutoff and .closed == false) |
54+
"Number: \(.number)\nTitle: \(.title)\nURL: \(.url)\nCreated: \(.createdAt)\nUpdated: \(.updatedAt)\nLocked: \(.locked)\n---"
5555
' discussions.json

0 commit comments

Comments
 (0)