Skip to content

Commit 9af5c53

Browse files
authored
Merge pull request #36 from NixOS/retirement-label
2 parents 1389c5d + 4395131 commit 9af5c53

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
@@ -88,7 +88,7 @@ The following sequence tests all code paths:
8888
PROD=1 scripts/retire.sh infinisil-test-org empty nixpkgs-committers members-test 'yesterday 1 month ago'
8989
```
9090

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

scripts/retire.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ for login in *; do
163163
trace git rm "$login"
164164
trace git commit -m "Automatic retirement of @$login"
165165
effect git push -f -u origin "$branchName"
166-
{
166+
prNumber=$({
167167
echo "This is an automated PR to retire @$login as a Nixpkgs committers due to not using their commit access for 1 year."
168168
echo ""
169169
echo "Make a comment with your motivation to keep commit access, otherwise this PR will be merged and implemented in 1 month."
@@ -178,7 +178,14 @@ for login in *; do
178178
-F "body=@-" \
179179
-f "head=$ORG:$branchName" \
180180
-f "base=$mainBranch" \
181-
-F "draft=true" >/dev/null
181+
-F "draft=true" \
182+
--jq .number
183+
)
184+
185+
effect gh api \
186+
--method POST \
187+
/repos/"$ORG"/"$MEMBER_REPO"/issues/"$prNumber"/labels \
188+
-f "labels[]=retirement" >/dev/null
182189
)
183190
else
184191
log "$login is active with $activityCount activities"

0 commit comments

Comments
 (0)