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

Repo-renaming bug exists in v2.1.18

Open
#901 12 comments 8 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
921
Forks
226
Avg merge
18h 3m
Merged PRs (30d)
14

Description

## Problem Description
When I run safe-settings with the latest release (v2.1.18), the repo PATCHes return an error about "name already exists on this account" because it is trying to rename all of my repos to one of the other repos in my org.

An earlier PR (#795) addressed this issue, and I finally gave the latest version a try today without my workaround [noted here](https://github.com/github/safe-settings/issues/775#issuecomment-2744424839), and now the error is back.

I see that a later PR (#806) reverted the change. I don't know if this was intentional or not, but I'm able to get around the issue by re-adding my patch:
```sh
# patching https://github.com/github/safe-settings/blob/2.1.18/lib/settings.js#L334
sed -i "334s/assign(repoConfig/assign({}, repoConfig/" ./lib/settings.js
```

### What is actually happening
Safe-settings won't run correctly without this change

### What is the expected behavior
Safe-settings is able to patch repos

### Error output, if available
```
{"message":"Validation Failed","errors":[{"resource":"Repository","code":"custom","field":"name","message":"name already exists on this account"}],"documentation_url":"https://docs.github.com/rest/repos/repos#update-a-repository","status":"422"}}
```

## Context

### Are you using the hosted instance of probot/settings or running your own?
self-run via GHA

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

#### Version of probot/settings
n/a

#### Version of GitHub Enterprise
n/a

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.