github-community-projects / github-community-projects/safe-settings

Can not rename repo

Open
#843 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
921
Forks
226
Avg merge
18h 3m
Merged PRs (30d)
14

Description

## Problem Description

I'm trying to setup and test `safe-settings` in a test organization. I've created a `clients` repo, alongside my `admin` repo for `safe-settings`. I'm trying to follow the process to rename a repo with `safe-settings` outlined here: https://github.com/github/safe-settings#use-safe-settings-to-rename-repos

I've created a feature-branch in the `admin` repo, renamed `clients.yml` to `clients3.yml`, to try to rename `clients` to `clients3` on Github. I pushed the feature-branch and created a pull-request for it:

```
$ git checkout -b rename-clients3
Switched to a new branch 'rename-clients3'
$ git mv .github/repos/clients.yml .github/repos/clients3.yml
$ git add .
$ git commit -m "Renamed clients repo"
[rename-clients3 6bb2be7] Renamed clients repo
1 file changed, 0 insertions(+), 0 deletions(-)
rename .github/repos/{clients.yml => clients3.yml} (100%)
$ git push origin rename-clients3
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 14 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 583 bytes | 583.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'rename-clients3' on GitHub by visiting:
remote: https://github.com/bw-safe-settings-test/admin/pull/new/rename-clients3
remote:
To github.com:bw-safe-settings-test/admin.git
* [new branch] rename-clients3 -> rename-clients3
$ gh pr create --title "Renamed clients repo"

Creating pull request for rename-clients3 into main in bw-safe-settings-test/admin

? Body
? What's next? Submit
https://github.com/bw-safe-settings-test/admin/pull/3
$
```

### What is actually happening

Upon the probot running, I receive a decoration on my pull-request indicating there's no action to perform from `safe-settings`:

![Image](https://github.com/user-attachments/assets/4c2d56d4-de8e-40f9-a66f-f25e3be75827)

Upon merging of the pull-request, `safe-settings` attempts to create a new repo named `clients3` from the specified template repo, instead of performing the rename action.

### What is the expected behavior

Based on the documentation, `safe-settings` should detect the renamed yml file, and rename the `clients` repo to `clients3`.

### Error output, if available

This is the log output of probot after creating the pull-request with the rename request:

```
INFO (probot): POST /api/github/webhooks 200 - 2ms
INFO (server): POST http://localhost:3000/api/github/webhooks - 200
DEBUG (probot): Pull_request opened !
DEBUG (probot): Is Admin repo event true
DEBUG (Safe-setting validator): GitHub request: POST https://api.github.com/repos/bw-safe-settings-test/admin/check-runs - 201
head_sha: "6bb2be7524774cc6a254f4b30d4184b07adb3d2f"
DEBUG (probot): {"status":201,"url":"https://api.github.com/repos/bw-safe-settings-test/admin/check-runs","headers":{"access-control-allow-origin":"*","access-control-expose-headers":"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset","cache-control":"private, max-age=60, s-maxage=60","content-length":"3169","content-security-policy":"default-src 'none'","content-type":"application/json; charset=utf-8","date":"Tue, 03 Jun 2025 14:57:45 GMT","etag":"\"d5c909692ed2303419f794a4353d2a158f6165cfd8d3164523a89fcfd50fee48\"","location":"https://api.github.com/repos/bw-safe-settings-test/admin/check-runs/43395008001","referrer-policy":"origin-when-cross-origin, strict-origin-when-cross-origin","server":"github.com","strict-transport-security":"max-age=31536000; includeSubdomains; preload","vary":"Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With","x-accepted-github-permissions":"checks=write","x-content-type-options":"nosniff","x-frame-options":"deny","x-github-api-version-selected":"2022-11-28","x-github-media-type":"github.v3; format=json","x-github-request-id":"D1A6:1389E1:3A94D1:73576E:683F0D69","x-ratelimit-limit":"5000","x-ratelimit-remaining":"4974","x-ratelimit-reset":"1748965803","x-ratelimit-resource":"core","x-ratelimit-used":"26","x-xss-protection":"0"},"data":{"id":43395008001,"name":"Safe-setting validator","node_id":"CR_kwDOO04D488AAAAKGotGAQ","head_sha":"6bb2be7524774cc6a254f4b30d4184b07adb3d2f","external_id":"","url":"https://api.github.com/repos/bw-safe-settings-test/admin/check-runs/43395008001","html_url":"https://github.com/bw-safe-settings-test/admin/runs/43395008001","details_url":"https://github.com/bw-safe-settings-test/","status":"queued","conclusion":null,"started_at":"2025-06-03T14:57:45Z","completed_at":null,"output":{"title":null,"summary":null,"text":null,"annotations_count":0,"annotations_url":"https://api.github.com/repos/bw-safe-settings-test/admin/check-runs/43395008001/annotations"},"check_suite":{"id":39543502619},"app":{"id":1308976,"client_id":"Iv23liOuDjTM7ZbQv3Me","slug":"bw-test-safe-settings","node_id":"A_kwHODK7FHM4AE_kw","owner":{"login":"bw-safe-settings-test","id":212780316,"node_id":"O_kgDODK7FHA","avatar_url":"https://avatars.githubusercontent.com/u/212780316?v=4","gravatar_id":"","url":"https://api.github.com/users/bw-safe-settings-test","html_url":"https://github.com/bw-safe-settings-test","followers_url":"https://api.github.com/users/bw-safe-settings-test/followers","following_url":"https://api.github.com/users/bw-safe-settings-test/following{/other_user}","gists_url":"https://api.github.com/users/bw-safe-settings-test/gists{/gist_id}","starred_url":"https://api.github.com/users/bw-safe-settings-test/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bw-safe-settings-test/subscriptions","organizations_url":"https://api.github.com/users/bw-safe-settings-test/orgs","repos_url":"https://api.github.com/users/bw-safe-settings-test/repos","events_url":"https://api.github.com/users/bw-safe-settings-test/events{/privacy}","received_events_url":"https://api.github.com/users/bw-safe-settings-test/received_events","type":"Organization","user_view_type":"public","site_admin":false},"name":"bw-test-safe-settings","description":"Safe Settings","external_url":"https://github.com/bw-safe-settings-test/","html_url":"https://github.com/apps/bw-test-safe-settings","created_at":"2025-05-22T14:21:32Z","updated_at":"2025-05-29T17:30:11Z","permissions":{"actions":"read","actions_variables":"write","administration":"write","checks":"write","contents":"write","environments":"write","issues":"write","members":"write","metadata":"read","organization_administration":"write","organization_custom_properties":"admin","pull_requests":"write","repository_custom_properties":"write","statuses":"write"},"events":["branch_protection_rule","check_run","check_suite","create","custom_property_values","member","pull_request","push","repository","repository_ruleset","team"]},"pull_requests":[{"url":"https://api.github.com/repos/bw-safe-settings-test/admin/pulls/3","id":2564300634,"number":3,"head":{"ref":"rename-clients3","sha":"6bb2be7524774cc6a254f4b30d4184b07adb3d2f","repo":{"id":994968547,"url":"https://api.github.com/repos/bw-safe-settings-test/admin","name":"admin"}},"base":{"ref":"main","sha":"b6121d190b739e37e6e72982514cebb44c6932b9","repo":{"id":994968547,"url":"https://api.github.com/repos/bw-safe-settings-test/admin","name":"admin"}}}]}}
INFO (probot): POST /api/github/webhooks 200 - 485ms
INFO (server): POST http://localhost:3000/api/github/webhooks - 200
DEBUG (probot): Check run was created!
DEBUG (probot): Is Admin repo event true
DEBUG (probot): Updating check run {"owner":"bw-safe-settings-test","repo":"admin","check_run_id":43395008001,"status":"in_progress","started_at":"2025-06-03T14:57:47.411Z","output":{"title":"Starting NOP","summary":"initiating..."}}
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/bw-safe-settings-test/admin/check-runs/43395008001 - 200
status: "in_progress"
started_at: "2025-06-03T14:57:47.411Z"
output: {
"title": "Starting NOP",
"summary": "initiating..."
}
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/compare/b6121d190b739e37e6e72982514cebb44c6932b9...6bb2be7524774cc6a254f4b30d4184b07adb3d2f - 200
DEBUG (probot): deploymentConfig is {"restrictedRepos":["admin",".github","safe-settings"]}
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github%2Fsettings.yml?ref=rename-clients3 - 200
DEBUG (probot): config for ref rename-clients3 is {"restrictedRepos":["admin",".github","safe-settings"],"repository":{"homepage":"https://bitwarden.com","auto_init":true,"template":"bw-safe-settings-test/template","security":{"enableVulnerabilityAlerts":true,"enableAutomatedSecurityFixes":true},"private":true,"visibility":"private","has_issues":true,"has_projects":false,"has_wiki":false,"default_branch":"main","allow_squash_merge":true,"allow_merge_commit":true,"allow_rebase_merge":true,"allow_auto_merge":true,"delete_branch_on_merge":true,"allow_update_branch":true,"archived":false},"teams":[{"name":"appsec","permission":"admin"}],"branches":[{"name":"default","protection":{"required_pull_request_reviews":{"required_approving_review_count":1,"dismiss_stale_reviews":true,"require_code_owner_reviews":true,"require_last_push_approval":true,"bypass_pull_request_allowances":{"apps":[],"users":[],"teams":[]},"dismissal_restrictions":{"users":[],"teams":[]}},"required_status_checks":{"strict":true,"checks":[]},"enforce_admins":true,"allow_force_pushes":false,"allow_deletions":false,"required_conversation_resolution":false,"restrictions":{"apps":[],"users":[],"teams":[]}}}],"validator":{"pattern":"[a-zA-Z0-9_-]+"}}
DEBUG (event): In getSubOrgConfigMap {"repo":"clients3","owner":"bw-safe-settings-test"}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): In loadConfigMap {"owner":"bw-safe-settings-test","repo":"admin","path":".github/suborgs","ref":"rename-clients3"}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github%2Fsuborgs?ref=rename-clients3 - 200
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github%2Fsuborgs%2Fappsec.yml?ref=rename-clients3 - 304
DEBUG (event): Cache hit for file .github/suborgs/appsec.yml
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): data = {}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github%2Fsuborgs%2Fbre.yml?ref=rename-clients3 - 304
DEBUG (event): Cache hit for file .github/suborgs/bre.yml
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): data = {}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): In getRepoConfigMap {"repo":"clients3","owner":"bw-safe-settings-test"}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github?ref=rename-clients3 - 200
DEBUG (event): repos directory info {"name":"repos","path":".github/repos","sha":"aad5efbea2c293c90e832b613842d6e8f8536d68","size":0,"url":"https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github/repos?ref=rename-clients3","html_url":"https://github.com/bw-safe-settings-test/admin/tree/rename-clients3/.github/repos","git_url":"https://api.github.com/repos/bw-safe-settings-test/admin/git/trees/aad5efbea2c293c90e832b613842d6e8f8536d68","download_url":null,"type":"dir","_links":{"self":"https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github/repos?ref=rename-clients3","git":"https://api.github.com/repos/bw-safe-settings-test/admin/git/trees/aad5efbea2c293c90e832b613842d6e8f8536d68","html":"https://github.com/bw-safe-settings-test/admin/tree/rename-clients3/.github/repos"}}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/git/trees/aad5efbea2c293c90e832b613842d6e8f8536d68?path=.github&ref=rename-clients3&recursive=0 - 200
DEBUG (event): Total overrides found in getRepoConfigMap are 1
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/admin/contents/.github%2Frepos%2Fclients3.yml?ref=rename-clients3 - 200
DEBUG (event): Cache miss for file .github/repos/clients3.yml
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): data = {"repository":{"description":"Bitwarden client apps (web, browser extension, desktop, and cli).","force_create":true,"template":"bitwarden/template","private":false,"visibility":"public","archived":false,"topics":["webextension","javascript","bitwarden","typescript","safari","chrome","firefox","angular","browser-extension","cli","desktop","electron","nodejs"],"allow_merge_commit":false,"allow_rebase_merge":false},"teams":[{"name":"bre","permission":"push"}]}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): repo configs = {"clients3.yml":{"repository":{"description":"Bitwarden client apps (web, browser extension, desktop, and cli).","force_create":true,"template":"bitwarden/template","private":false,"visibility":"public","archived":false,"topics":["webextension","javascript","bitwarden","typescript","safari","chrome","firefox","angular","browser-extension","cli","desktop","electron","nodejs"],"allow_merge_commit":false,"allow_rebase_merge":false},"teams":[{"name":"bre","permission":"push"}]}}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): clients3 not in restricted repos admin,.github,safe-settings
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Process normally... Not a SubOrg config change or SubOrg config was changed and this repo is part of it. {"repo":"clients3","owner":"bw-safe-settings-test"} suborg config undefined
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): found a matching repoconfig for this repo {"homepage":"https://bitwarden.com","auto_init":true,"template":"bitwarden/template","security":{"enableVulnerabilityAlerts":true,"enableAutomatedSecurityFixes":true},"private":false,"visibility":"public","has_issues":true,"has_projects":false,"has_wiki":false,"default_branch":"main","allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"delete_branch_on_merge":true,"allow_update_branch":true,"archived":false,"name":"clients3","org":"bw-safe-settings-test","description":"Bitwarden client apps (web, browser extension, desktop, and cli).","force_create":true,"topics":["webextension","javascript","bitwarden","typescript","safari","chrome","firefox","angular","browser-extension","cli","desktop","electron","nodejs"]}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): suborg config for clients3 is undefined
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): consolidated config is {"restrictedRepos":["admin",".github","safe-settings"],"repository":{"homepage":"https://bitwarden.com","auto_init":true,"template":"bitwarden/template","security":{"enableVulnerabilityAlerts":true,"enableAutomatedSecurityFixes":true},"private":false,"visibility":"public","has_issues":true,"has_projects":false,"has_wiki":false,"default_branch":"main","allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"delete_branch_on_merge":true,"allow_update_branch":true,"archived":false,"name":"clients3","org":"bw-safe-settings-test","description":"Bitwarden client apps (web, browser extension, desktop, and cli).","force_create":true,"topics":["webextension","javascript","bitwarden","typescript","safari","chrome","firefox","angular","browser-extension","cli","desktop","electron","nodejs"]},"teams":[{"name":"appsec","permission":"admin"},{"name":"bre","permission":"push"}],"branches":[{"name":"default","protection":{"required_pull_request_reviews":{"required_approving_review_count":1,"dismiss_stale_reviews":true,"require_code_owner_reviews":true,"require_last_push_approval":true,"bypass_pull_request_allowances":{"apps":[],"users":[],"teams":[]},"dismissal_restrictions":{"users":[],"teams":[]}},"required_status_checks":{"strict":true,"checks":[]},"enforce_admins":true,"allow_force_pushes":false,"allow_deletions":false,"required_conversation_resolution":false,"restrictions":{"apps":[],"users":[],"teams":[]}}}],"validator":{"pattern":"[a-zA-Z0-9_-]+"}}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Found section teams in the config. Creating plugin...
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Found section branches in the config. Creating plugin...
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Found section validator in the config. Creating plugin...
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Syncing Repo clients3
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/clients3 - 404
DEBUG (event): Creating repo using template bitwarden/template
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Creating Repo using template {"method":"POST","url":"https://api.github.com/orgs/bw-safe-settings-test/repos","headers":{"accept":"application/vnd.github.v3+json","user-agent":"probot/13.4.4 octokit-core.js/5.2.0 Node.js/20.18.2 (darwin; arm64)","content-type":"application/json; charset=utf-8"},"body":{"homepage":"https://bitwarden.com","auto_init":true,"security":{"enableVulnerabilityAlerts":true,"enableAutomatedSecurityFixes":true},"private":false,"visibility":"public","has_issues":true,"has_projects":false,"has_wiki":false,"default_branch":"main","allow_squash_merge":true,"allow_merge_commit":false,"allow_rebase_merge":false,"allow_auto_merge":true,"delete_branch_on_merge":true,"allow_update_branch":true,"archived":false,"name":"clients3","description":"Bitwarden client apps (web, browser extension, desktop, and cli).","force_create":true,"repo":"clients3","owner":"bw-safe-settings-test"},"request":{"retryCount":1}}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (event): Finding teams for bw-safe-settings-test/clients3
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/clients3/teams - 404
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/clients3 - 404
DEBUG (octokit): GitHub request: GET https://api.github.com/repos/bw-safe-settings-test/clients3/topics - 404
DEBUG (event): Stats [
{
"type": "INFO",
"plugin": "Repository",
"repo": "clients3",
"endpoint": "https://api.github.com/repos/bw-safe-settings-test/bitwarden%2Ftemplate/generate",
"body": {
"owner": "bw-safe-settings-test",
"name": "clients3",
"private": true,
"description": "Bitwarden client apps (web, browser extension, desktop, and cli)."
},
"action": {
"msg": "Create Repo Using Template",
"additions": null,
"modifications": null,
"deletions": null
}
}
]
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: POST https://api.github.com/repos/bw-safe-settings-test/admin/issues/3/comments - 201
body: "\n#### :robot: Safe-Settings config changes detected:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n"
DEBUG (event): Completing check run {"owner":"bw-safe-settings-test","repo":"admin","check_run_id":43395008001,"status":"completed","conclusion":"success","completed_at":"2025-06-03T14:57:50.468Z","output":{"title":"Safe-Settings Dry-Run Finished with success","summary":"* Run on: ` Tue Jun 03 2025 10:57:49 GMT-0400 (Eastern Daylight Time) `\n\n* Number of repos that were considered: `1 `\n\n### Breakdown of changes\n| Repo |\n| -- | \n| clients3 |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n`None`\n"}}
id: "1ba511c0-408b-11f0-9dcb-e5cc1425f4cc"
DEBUG (octokit): GitHub request: PATCH https://api.github.com/repos/bw-safe-settings-test/admin/check-runs/43395008001 - 200
status: "completed"
conclusion: "success"
completed_at: "2025-06-03T14:57:50.468Z"
output: {
"title": "Safe-Settings Dry-Run Finished with success",
"summary": "* Run on: ` Tue Jun 03 2025 10:57:49 GMT-0400 (Eastern Daylight Time) `\n\n* Number of repos that were considered: `1 `\n\n### Breakdown of changes\n| Repo |\n| -- | \n| clients3 |\n\n:hand: -> Changes to be applied to the GitHub repository.\n:grey_exclamation: -> nothing to be changed in that particular GitHub repository.\n\n### Breakdown of errors\n\n`None`\n"
}
INFO (probot): POST /api/github/webhooks 200 - 3793ms
INFO (server): POST http://localhost:3000/api/github/webhooks - 200
INFO (probot): POST /api/github/webhooks 200 - 0ms
INFO (server): POST http://localhost:3000/api/github/webhooks - 200
INFO (probot): POST /api/github/webhooks 200 - 0ms
INFO (server): POST http://localhost:3000/api/github/webhooks - 200
```

## Context

### Are you using the hosted instance of probot/settings or running your own?

Running locally during development. Unmodified, but just running `npm dev` in the repo code.

### If running your own instance, are you using it with github.com or GitHub Enterprise?

github.com

#### Version of probot/settings

package.json of `safe-settings`: 0.1.0-rc.26
commit sha: `3e5d4fe23f2923e0d12e23d2c5d5473859776f3f`

#### Version of GitHub Enterprise
N/AMsgPluginRepoAdditionsDeletionsModifications

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.