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

ReferenceError in settings.js for suborgs parsing

Open
#267 0 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

The suborgs functionality is broken and the app errors out when trying to parse a file in the `.github/suborgs/` folder.

### What is actually happening

The app fails with:
```
ERROR (event): subOrgConfigs is not defined
ReferenceError: subOrgConfigs is not defined
at Settings.getSubOrgConfig (.../safe-settings/lib/settings.js:166:9)
```

This is due to line 166 having an invalid reference `return subOrgConfigs[k]` which should be `return this.subOrgConfigs[k]`. The app works correctly after making this change locally.

### What is the expected behavior

Correct parsing of the suborg yaml files.

### Error output, if available

```
ERROR (event): subOrgConfigs is not defined
ReferenceError: subOrgConfigs is not defined
at Settings.getSubOrgConfig (.../safe-settings/lib/settings.js:166:9)
```

## Context

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

Running my own using the latest code on `main-enterprise`

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

GHEC

#### Version of probot/settings

Latest on `main-enterprise`

#### Version of GitHub Enterprise

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.