From 4395131497881e842ada07fc663ac7a0807da435 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sat, 27 Sep 2025 03:39:31 +0200 Subject: [PATCH] Automatically add retirement label Makes it easier to filter for such PRs --- scripts/README.md | 2 +- scripts/retire.sh | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 5c0e41f..487db0a 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -83,7 +83,7 @@ The following sequence tests all code paths: PROD=1 scripts/retire.sh infinisil-test-org empty nixpkgs-committers members 'yesterday 1 month ago' ``` - Check that it created the PR appropriately. + Check that it created the PR appropriately, including assigning the "retirement" label. You can undo this step by closing the PR. 3. Run it again to simulate CI running again later: ```bash diff --git a/scripts/retire.sh b/scripts/retire.sh index bffd73a..50d4ae7 100755 --- a/scripts/retire.sh +++ b/scripts/retire.sh @@ -123,7 +123,7 @@ for login in *; do trace git rm "$login" trace git commit -m "Automatic retirement of @$login" effect git push -f -u origin "$branchName" - { + prNumber=$({ echo "This is an automated PR to retire @$login as a Nixpkgs committers due to not using their commit access for 1 year." echo "" echo "Make a comment with your motivation to keep commit access, otherwise this PR will be merged and implemented in 1 month." @@ -134,7 +134,14 @@ for login in *; do -F "body=@-" \ -f "head=$ORG:$branchName" \ -f "base=$mainBranch" \ - -F "draft=true" >/dev/null + -F "draft=true" \ + --jq .number + ) + + effect gh api \ + --method POST \ + /repos/"$ORG"/"$MEMBER_REPO"/issues/"$prNumber"/labels \ + -f "labels[]=retirement" >/dev/null ) else log "$login is active with $activityCount activities"