Skip to content

Commit

Permalink
fix(environment): skip filter if no argument is given
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Nov 22, 2021
1 parent 9ae939d commit 1f47d10
Show file tree
Hide file tree
Showing 6 changed files with 4,393 additions and 2,702 deletions.
8 changes: 7 additions & 1 deletion cloudflare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ export default async function getDeploymentUrl(
const builds = data.result
.filter((d) => d.source.config.repo_name === repo)
.filter((d) => d.deployment_trigger.metadata.branch === branch)
.filter((d) => environment == null || d.environment === environment)
.filter((d) => {
if (environment && environment.length > 0) {
return d.environment === environment
} else {
return true
}
})
.filter(
(d) =>
commitHash == null ||
Expand Down
Loading

0 comments on commit 1f47d10

Please sign in to comment.