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

Renamed or removed Environments are sent DELETE requests in nop mode

Open
#799 1 comment 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

As per the title, when Environments are renamed or removed entirely in the config and the app is executed in `nop` mode via a pull request check run, the environment will be deleted from the associated repositories.

### What is actually happening

As per the title, when Environments are renamed or removed entirely in the config and the app is executed in `nop` mode via a pull request check run, the environment REST endpoint will be sent a DELETE request.

### What is the expected behavior

In `nop` mode no changes should be made to repository settings.

### Error output, if available

Not errors, but these logs were generated on a no-op dry run of safe-settings where `balena-staging.com+sign-api-key` had been deleted from the settings.

```
{"level":20,"time":1740682249048,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8plus/environments/balena-staging.com%2Bsign-api-key - 204"}
2025-02-27 13:50:48.103
{"level":20,"time":1740682248103,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8plus/environments/balena-cloud.com%2Bsign-api-key - 204"}
2025-02-27 13:50:41.042
{"level":20,"time":1740682241041,"pid":24,"hostname":"safe-settings-d86c9d9d7-bwdrd","name":"probot","name":"probot","name":"octokit","msg":"GitHub request: DELETE https://api.github.com/repos/balena-os/balena-iot-gate-imx8/environments/balena-staging.com%2Bsign-api-key - 204"}
```

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

We previously thought this issue had been addressed here: https://github.com/github/safe-settings/pull/691

Last reproduced in https://github.com/github/safe-settings/releases/tag/2.1.16

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