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

Deployment settings include setting not applied

Open
#325 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

When configuring the `deployment-settings.yml` to set an explicit set of repositories to be managed safe-settings is not honouring the list of repositories.

### What is actually happening

When setting the `include` array in `deployment-settings.yml` the top level org settings are being applied on repositories not in this set.

### What is the expected behavior

Settings are applied only to the repositories listed.

### Error output, if available

Config snippet for `deployment-settings.yml`

```
restrictedRepos:
# You can exclude certain repos from safe-settings processing
# If no file is specified, then the following repositories - 'admin', '.github', 'safe-settings' are exempted by default
#exclude: ['admin', '.github', 'safe-settings']
# Alternatively you can only include certain repos
include: ['repo-team2', 'test1']
```

I also tried with exclude and include both specified as shown below, in both cases the settings were applied on repositories not listed in the `include` list.

```
restrictedRepos:
# You can exclude certain repos from safe-settings processing
# If no file is specified, then the following repositories - 'admin', '.github', 'safe-settings' are exempted by default
exclude: ['admin', '.github', 'safe-settings']
# Alternatively you can only include certain repos
include: ['repo-team2', 'test1']
```

It looks like https://github.com/github/safe-settings/blob/5dd8e7987f6bf685a44ad857d0c0cc3092cd7002/index.js#L98-L103 is not picking up the `.github/deployment-settings.yml` file as being present.

## Context

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

Self hosted

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

Github.com

#### Version of probot/settings

safe-settings@0.1.0-rc.26 start
Probot v12.2.8 (Node.js: v18.11.0)

#### 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.