Closed Myoldmopar closed 3 years ago
Tested this in a standalone project and verified it finds the commit message now, so Decent should skip it.
require 'octokit' token = File.read("/home/edwin/Documents/token").strip! @client = Octokit::Client.new(:access_token => token) branches = %w[develop conv-coeff-enums-2 TestSkipDecent auto-window-mult] branches.each do |b| branch_details = @client.branch('NREL/EnergyPlus', b) skip_message_present = false begin skip_message_present = branch_details.commit.commit.message['[decent_ci_skip]'] puts "Skipping branch #{b}" if skip_message_present rescue # ignore end next if skip_message_present && b != 'develop' puts "Working on branch #{b}" end
prints:
Working on branch develop Working on branch conv-coeff-enums-2 Skipping branch TestSkipDecent Working on branch auto-window-mult
Which is correct, because the TestSkipDecent branch has [decent_ci_skip] in the commit message. Decent will also always run for the develop branch.
[decent_ci_skip]
Tested this in a standalone project and verified it finds the commit message now, so Decent should skip it.
prints:
Which is correct, because the TestSkipDecent branch has
[decent_ci_skip]
in the commit message. Decent will also always run for the develop branch.