Sha256: 90135de9f72bcafa1c725e10c4531a44b28d1cf9863eba38fa404d348d811c34

Contents?: true

Size: 708 Bytes

Versions: 10

Compression:

Stored size: 708 Bytes

Contents

module Fastlane
  module Actions
    module SharedValues
      GIT_REPO_WAS_CLEAN_ON_START = :GIT_REPO_WAS_CLEAN_ON_START
    end

    # Raises an exception and stop the lane execution if the repo is not in a clean state
    class EnsureGitStatusCleanAction
      def self.run(_params)
        repo_clean = `git status --porcelain`.empty?

        if repo_clean
          Helper.log.info 'Git status is clean, all good! 💪'.green
          Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START] = true
        else
          raise 'Git repository is dirty! Please ensure the repo is in a clean state by commiting/stashing/discarding all changes first.'.red
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fastlane-0.6.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.6.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.5.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.4.2 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.4.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.4.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.3.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.2.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.2.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-0.1.19 lib/fastlane/actions/ensure_git_status_clean.rb