Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/orphaned-pr-environments
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ echo "::endgroup::"
echo "::group::List PRs with PR environments"
echo terraform -chdir="infra/${app_name}/service" workspace list
workspaces="$(terraform -chdir="infra/${app_name}/service" workspace list)"
pr_nums="$(echo "${workspaces}" | grep -o 'p-[0-9]\+' | sed 's/p-//')"

# Search for workspaces that start with "p-" and extract the PR numbers
# The "|| true" is used to avoid errors if there are no PR environments
pr_nums="$(echo "${workspaces}" | grep -o 'p-[0-9]\+' || true | sed 's/p-//')"
echo "PRs"
echo "${pr_nums}"
echo "::endgroup::"
Expand Down
Loading