Skip to content

Commit

Permalink
Merge pull request #55 from runwaylab/type-update
Browse files Browse the repository at this point in the history
Type updates and branch-deploy type checks
  • Loading branch information
GrantBirki authored Jan 28, 2025
2 parents e6eed2d + 617a4a4 commit d3cd6c9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion acceptance/logs/expected.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ INFO: 📖 loading runway configuration
DEBUG: attempting to load config from acceptance/config/config.yml
INFO: ✅ loaded configuration successfully
INFO: 🚚 2 projects loaded
INFO: 🛫 starting runway - version: v0.5.2
INFO: 🛫 starting runway - version: v0.5.3
INFO: 📦 starting project project-1
INFO: 🕐 scheduling event with interval 3s for project-1
INFO: 📦 starting project project-2
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: runway
version: 0.5.2
version: 0.5.3

authors:
- GrantBirki
Expand Down
9 changes: 8 additions & 1 deletion src/runway/events/github_deployment.cr
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ class GitHubDeployment < BaseEvent
begin
deployment_payload = deployment.payload.to_json
@log.debug { "deployment_payload for #{@repo}: #{deployment_payload}" }

# if the deployment type is not of the branch-deploy type (or if it's not set), we'll skip hydration
if deployment_payload["type"].try(&.to_s) != "branch-deploy"
@log.debug { "deployment type is not branch-deploy for #{@repo} - skipping branch_deploy payload hydration" }
return nil
end

BranchDeployPayload.from_json(deployment_payload)
rescue e : Exception
log_message = "failed to parse branch_deploy payload for #{@repo}: #{e.message}"
Expand All @@ -233,7 +240,7 @@ class GitHubDeployment < BaseEvent
# It then sorts the deployments as well
# @param deployments [String] the deployments raw JSON response
# @return [Array] the parsed, filtered, and sorted deployments
protected def parse_and_filter_deployments(deployments : Octokit::Connection::Paginator(Octokit::Models::Deployment)) : Array
protected def parse_and_filter_deployments(deployments : Octokit::Connection::Paginator(Octokit::Models::Deployment)) : Array(Octokit::Models::Deployment)
deployments = filter_deployments(deployments.records)
sort_deployments(deployments)
end
Expand Down
2 changes: 1 addition & 1 deletion src/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Runway
VERSION = "v0.5.2"
VERSION = "v0.5.3"
end

0 comments on commit d3cd6c9

Please sign in to comment.