Closed rajlearner17 closed 2 years ago
Here's one way that it happens (1) with possible workaround in (3). Not sure what Postgres is doing with that ||
concatenation in conjunction with an inline case statement, maybe there's a way to parenthesize that'll fix it?
For what it's worth, I prefer concat
for joining more than 2 things in a readable way.
select
html_url as resource,
case
when blog is null then 'alarm'
else 'ok'
end as status,
name || ' homepage is ' || case when (blog is null) then 'not set' else blog end || '.' as reason
from
github_my_organization
+--------------------------------+--------+------------
| resource | status | reason
+--------------------------------+--------+------------
| https://github.com/JonUdell | alarm | <null>
+--------------------------------+--------+------------
select
html_url as resource,
case
when blog is null then 'alarm'
else 'ok'
end as status,
case when blog is null then 'not set' else blog end as reason
from
github_my_organization
+--------------------------------+--------+------------
| resource | status | reason
+--------------------------------+--------+------------
| https://github.com/JonUdell | alarm | not set
+--------------------------------+--------+------------
select
html_url as resource,
case
when blog is null then 'alarm'
else 'ok'
end as status,
concat(
name,
' homepage is ',
case
when blog is null then 'not set'
else blog
end,
'.'
) as reason
from
github_my_organization
+--------------------------------+--------+----------------------------------------------------------
| resource | status | reason
+--------------------------------+--------+----------------------------------------------------------
| https://github.com/JonUdell | alarm | Jon Udell's (inactive) GitHub org homepage is not set.
+--------------------------------+--------+----------------------------------------------------------
Describe the bug GitHub Organization with non-matching conditions of
Organization Best Practices
controls fails e.g.Organization members should not be able to create public repositories
Organization default repository permissions should be limited
Steampipe version (
steampipe -v
) Example: v0.9.1Plugin version (
steampipe plugin list
) GitHub: v0.8.1To reproduce You can create sample organization without all required best practice parameters and run GitHub Sherlock mod as below
steampipe check github_sherlock.benchmark.org_best_practices
Expected behavior A clear and concise description of what you expected to happen.
Additional context Add any other context about the problem here.