Skip to content

Commit 4395131

Browse files
committed
Automatically add retirement label
Makes it easier to filter for such PRs
1 parent 0ddf4a2 commit 4395131

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The following sequence tests all code paths:
8383
PROD=1 scripts/retire.sh infinisil-test-org empty nixpkgs-committers members 'yesterday 1 month ago'
8484
```
8585

86-
Check that it created the PR appropriately.
86+
Check that it created the PR appropriately, including assigning the "retirement" label.
8787
You can undo this step by closing the PR.
8888
3. Run it again to simulate CI running again later:
8989
```bash

scripts/retire.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ for login in *; do
123123
trace git rm "$login"
124124
trace git commit -m "Automatic retirement of @$login"
125125
effect git push -f -u origin "$branchName"
126-
{
126+
prNumber=$({
127127
echo "This is an automated PR to retire @$login as a Nixpkgs committers due to not using their commit access for 1 year."
128128
echo ""
129129
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
134134
-F "body=@-" \
135135
-f "head=$ORG:$branchName" \
136136
-f "base=$mainBranch" \
137-
-F "draft=true" >/dev/null
137+
-F "draft=true" \
138+
--jq .number
139+
)
140+
141+
effect gh api \
142+
--method POST \
143+
/repos/"$ORG"/"$MEMBER_REPO"/issues/"$prNumber"/labels \
144+
-f "labels[]=retirement" >/dev/null
138145
)
139146
else
140147
log "$login is active with $activityCount activities"

0 commit comments

Comments
 (0)