-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(github-actions-usage): Add
view_github_actions
SQL view
This view shows the archived status of a repository, the name of the Action being used, and the version.
- Loading branch information
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/common/prisma/views/public/view_github_actions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
WITH data AS ( | ||
SELECT | ||
tbl.evaluated_on, | ||
tbl.full_name, | ||
tbl.workflow_path, | ||
use_string.use_string AS ACTION, | ||
split_part(use_string.use_string, '@' :: text, 1) AS action_name, | ||
split_part(use_string.use_string, '@' :: text, '-1' :: integer) AS version | ||
FROM | ||
guardian_github_actions_usage tbl, | ||
LATERAL unnest(tbl.workflow_uses) use_string(use_string) | ||
) | ||
SELECT | ||
d.evaluated_on, | ||
d.full_name, | ||
r.archived, | ||
d.workflow_path, | ||
d.action, | ||
d.action_name, | ||
d.version | ||
FROM | ||
( | ||
data d | ||
JOIN github_repositories r ON ((d.full_name = r.full_name)) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters