Skip to content

Commit

Permalink
sync-shared-config: fix style and style checks.
Browse files Browse the repository at this point in the history
- Use `exclude?` instead of `include?` to make RuboCop happy
- Properly check the `sync` jobs success so that auto-merge is not
  run if jobs are failing
  • Loading branch information
MikeMcQuaid committed Jun 11, 2024
1 parent 05db2e1 commit d4469de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/actions/sync/shared-config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,16 @@ def git(*args)
end

# Update Gemfile.lock if it exists, based on the Ruby version.
#
# rubocop:disable Homebrew/NegateInclude
# We don't have Homebrew exclude? method here.
if !custom_ruby_version_repos.include?(repository_name) && (target_directory_path/"Gemfile.lock").exist?
Dir.chdir target_directory_path do
puts "Running bundle install..."
system "bundle update --ruby --bundler --quiet >/dev/null"
end
end
# rubocop:enable Homebrew/NegateInclude

out, err, status = Open3.capture3("git", "-C", target_directory, "status", "--porcelain", "--ignore-submodules=dirty")
raise err unless status.success?
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sync-shared-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
conclusion:
needs: sync
runs-on: ubuntu-latest
if: always()
steps:
- name: Conclusion
run: echo "Sync shared configurations completed"
- name: Result
run: ${{ needs.sync.result == 'success' }}

0 comments on commit d4469de

Please sign in to comment.