Skip to content

Commit

Permalink
Deal better with missing github repo for groups
Browse files Browse the repository at this point in the history
This also allows for only some repos to be pushed, if configured

Signed-off-by: Mike Beattie <mike@ethernal.org>
  • Loading branch information
mjbnz committed Feb 17, 2022
1 parent ab5bc1c commit 7d072e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/oxidized/hook/githubrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ def run_hook(ctx)
creds = credentials(ctx.node)
url = remote_repo(ctx.node)

if url.nil? || url.empty?
log "No repository defined for #{ctx.node.group}/#{ctx.node.name}", :debug
return
end

log "Pushing local repository(#{repo.path})..."
log "to remote: #{url}"

Expand Down Expand Up @@ -89,8 +94,10 @@ def remote_repo(node)
cfg.remote_repo
elsif cfg.remote_repo[node.group].is_a?(String)
cfg.remote_repo[node.group]
else
elsif cfg.remote_repo[node.group].url.is_a?(String)
cfg.remote_repo[node.group].url
else
nil
end
end
end

0 comments on commit 7d072e6

Please sign in to comment.