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

404 When force_create repo -> Not inserting Org Name

Open
#174 3 comments 0 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

Working to prototype and implement safe-settings. While working through the bug, I created blank settings.yml, suborg file and a new repo file under .github/repos/test-repo.yml.

When creating a new yaml file for a repo and setting force-create to true, it throws a 404 when attempting to create the repository.

### What is actually happening

When the application is trying to do an HTTP Post to github it is getting a 404. The 404 is caused by the URL not having the org name in it.

status: 404
request: {
method: "POST"
url: "https://api.github.com/orgs//repos"

### What is the expected behavior

Repository is created

### Error output, if available

```
status: 404
request: {
method: "POST"
url: "https://api.github.com/orgs//repos"
headers: {
"accept": "application/vnd.github.nebula-preview+json",
"user-agent": "probot/12.2.0 octokit-core.js/3.5.1 Node.js/14.16.1 (win32; x64)",
"authorization": "token [REDACTED]",
"content-type": "application/json; charset=utf-8"
}
body: "{\"name\":\"test-repo-1\",\"force_create\":true,\"description\":\"description of the repo\",\"homepage\":\"https://example.github.io/\",\"auto_init\":true,\"private\":true,\"visibility\":\"private\",\"has_issues\":true,\"has_projects\":true,\"has_wiki\":true,\"default_branch\":\"main\",\"license_template\":\"mit\",\"repo\":\"test-repo\",\"owner\":\"test-org\"}"
request: {
"retryCount": 1
}
}
```

## Context

This is when first attempting to get the bot running and creating/maintaining repositories.

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

Running on NPM locally on my machine.

Using some custom settings for self signed certs.

Windows 10

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

Github Enterprise Cloud

#### Version of probot/settings

Pulled a copy of the main branch and ran npm install tonight

#### Version of GitHub Enterprise

Github Enterprise Cloud

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.