Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions deployment/server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -l

#
# SPDX-License-Identifier: BSD-2-Clause
Expand All @@ -12,8 +12,10 @@
# frozen_string_literal: true
#

source /home/githubchecks/.rvm/scripts/rvm

echo ">> Running migration"
rake db:migrate
RAILS_ENV=production RACK_ENV=production bundle exec rake db:migrate

echo ">> Running server"
RAILS_ENV=production RACK_ENV=production rackup -o 0.0.0.0 -p 4667 config.ru
RAILS_ENV=production RACK_ENV=production bundle exec rackup -o 0.0.0.0 -p 4667 config.ru
13 changes: 9 additions & 4 deletions lib/github/build/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# @param [CheckSuite] check_suite The CheckSuite to handle.
# @param [Github::Check] github The Github::Check instance to use.
# @param [Array] jobs The jobs to create for the CheckSuite.
# @param [String] Stage Plan name.
# @param [Integer] logger_level The logging level to use (default: Logger::INFO).
def initialize(check_suite, github, jobs, name, logger_level: Logger::INFO)
@check_suite = check_suite
Expand Down Expand Up @@ -120,7 +119,7 @@

return if stage_config.nil?

stage = Stage.find_by(check_suite: @check_suite, name: "#{stage_config.github_check_run_name} - #{@name}")
stage = Stage.find_by(check_suite: @check_suite, name: stage_name(stage_config))

logger(Logger::INFO, "create_jobs - #{job.inspect} -> #{stage.inspect}")

Expand All @@ -133,7 +132,7 @@
# @param [StageConfiguration] stage_config The stage configuration.
def create_check_run_stage(stage_config)
logger(Logger::INFO, "create_check_run_stage - #{stage_config.github_check_run_name} - #{@name}")
stage = Stage.find_by(name: "#{stage_config.github_check_run_name} - #{@name}", check_suite_id: @check_suite.id)
stage = Stage.find_by(name: stage_name(stage_config), check_suite_id: @check_suite.id)

return create_stage(stage_config) if stage.nil?
return unless stage.configuration.can_retry?
Expand All @@ -149,7 +148,7 @@
# @param [StageConfiguration] stage_config The stage configuration.
# @return [Stage] The created stage.
def create_stage(stage_config)
name = "#{stage_config.github_check_run_name} - #{@name}"
name = stage_name(stage_config)

stage =
Stage.create(check_suite: @check_suite,
Expand Down Expand Up @@ -181,6 +180,12 @@
output
end

def stage_name(stage_config)
return stage_config.github_check_run_name if @check_suite.pull_request.plans.count == 1

Check warning on line 184 in lib/github/build/action.rb

View workflow job for this annotation

GitHub Actions / Rubocop

[rubocop] reported by reviewdog 🐶 Use `one?` instead. (https://rubystyle.guide#collection-querying) Raw Output: lib/github/build/action.rb:184:86: C: Style/CollectionQuerying: Use `one?` instead. (https://rubystyle.guide#collection-querying)

"#{stage_config.github_check_run_name} - #{@name}"
end

##
# Logs a message with the given severity.
#
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/github/build/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
let(:fake_client) { Octokit::Client.new }
let(:fake_github_check) { Github::Check.new(nil) }
let(:check_suite) { create(:check_suite) }
let(:stage) { create(:stage, name: 'Build - Tato', check_suite: check_suite) }
let(:stage) { create(:stage, name: 'Build', check_suite: check_suite) }
let(:jobs) do
[
{
Expand Down
Loading