From b68aaa8802fe155da53526100c612713d6669333 Mon Sep 17 00:00:00 2001 From: Danielle Date: Fri, 30 Aug 2024 15:01:35 +0100 Subject: [PATCH] removed deprecated any function --- .../pull-request-comment-summary.rego | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/notification/pull-request-comment-summary.rego b/notification/pull-request-comment-summary.rego index 784d483..1a86664 100644 --- a/notification/pull-request-comment-summary.rego +++ b/notification/pull-request-comment-summary.rego @@ -23,9 +23,27 @@ added contains row if { # regal ignore:line-length row := sprintf("| Added | `%s` |
Value`%s`
|", [x.entity.address, x.entity.data.values]) + x.action == "added" + x.entity.entity_type == "resource" + not x.moved +} + +added contains row if { + some x in input.run_updated.run.changes + + # regal ignore:line-length + row := sprintf("| Added | `%s` |
Value`%s`
|", [x.entity.address, x.entity.data.values]) + x.action == "destroy-Before-create-replaced" + x.entity.entity_type == "resource" + not x.moved +} + +added contains row if { + some x in input.run_updated.run.changes - # regal ignore:deprecated-builtin - any([x.action == "added", x.action == "destroy-Before-create-replaced", x.action == "create-Before-destroy-replaced"]) + # regal ignore:line-length + row := sprintf("| Added | `%s` |
Value`%s`
|", [x.entity.address, x.entity.data.values]) + x.action == "create-Before-destroy-replaced" x.entity.entity_type == "resource" not x.moved } @@ -43,9 +61,23 @@ changed contains row if { deleted contains row if { some x in input.run_updated.run.changes row := sprintf("| Deleted | `%s` | :x: |", [x.entity.address]) + x.action == "deleted" + x.entity.entity_type == "resource" + not x.moved +} - # regal ignore:line-length, deprecated-builtin - any([x.action == "deleted", x.action == "destroy-Before-create-replaced", x.action == "create-Before-destroy-replaced"]) +deleted contains row if { + some x in input.run_updated.run.changes + row := sprintf("| Deleted | `%s` | :x: |", [x.entity.address]) + x.action == "destroy-Before-create-replaced" + x.entity.entity_type == "resource" + not x.moved +} + +deleted contains row if { + some x in input.run_updated.run.changes + row := sprintf("| Deleted | `%s` | :x: |", [x.entity.address]) + x.action == "create-Before-destroy-replaced" x.entity.entity_type == "resource" not x.moved }