Skip to content

Commit

Permalink
Fix existing existing environment variable filter
Browse files Browse the repository at this point in the history
This boolean was reversed when filtering existing variables,
so it consistently sent a POST request to existing vars.

Signed-off-by: Kyle Harding <[email protected]>
  • Loading branch information
klutchell committed Jan 3, 2025
1 parent ee5909a commit e79e222
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/environments.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module.exports = class Environments extends Diffable {
for (const variable of attrs.variables) {
const existingVariable = existingVariables.find((_var) => _var.name === variable.name)
if (existingVariable) {
existingVariables = existingVariables.filter(_var => _var.name !== variable.name)
existingVariables = existingVariables.filter(_var => _var.name === variable.name)
if (existingVariable.value !== variable.value) {
await this.github.request('PATCH /repos/:org/:repo/environments/:environment_name/variables/:variable_name', {
org: this.repo.owner,
Expand Down

0 comments on commit e79e222

Please sign in to comment.