mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 17:28:57 +00:00
ci: Add action to lock closed PRs
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
name: "Lock closed PRs"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 */8 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt install -y jq
|
||||
|
||||
- name: Lock closed PRs
|
||||
run: |
|
||||
cmd=$(gh pr list --repo "$REPO" -L 100 --state closed --json number,updatedAt|jq '[.[] | select(.updatedAt >= (now - (7 * 24 * 60 * 60) | todate))] | sort_by(.updatedAt) | .[] | {number: .number, updatedAt: .updatedAt}'| jq '.number')
|
||||
|
||||
for num in $cmd; do
|
||||
gh pr lock --repo "$REPO" --reason "resolved" "$num"
|
||||
done
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.FLATHUBBOT_TOKEN }}
|
||||
REPO: flathub/flathub
|
||||
Reference in New Issue
Block a user