Sha256: 9a70e70140f540e6120ffa9781b2cd06416f71756e381dd40404b97641ffce84

Contents?: true

Size: 1.06 KB

Versions: 21

Compression:

Stored size: 1.06 KB

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 < Action
      def self.run(params)
        repo_clean = `git status --porcelain`.empty?

        if repo_clean
          UI.success('Git status is clean, all good! 💪')
          Actions.lane_context[SharedValues::GIT_REPO_WAS_CLEAN_ON_START] = true
        else
          UI.user_error!("Git repository is dirty! Please ensure the repo is in a clean state by commiting/stashing/discarding all changes first.")
        end
      end

      def self.description
        "Raises an exception if there are uncommited git changes"
      end

      def self.output
        [
          ['GIT_REPO_WAS_CLEAN_ON_START', 'Stores the fact that the git repo was clean at some point']
        ]
      end

      def self.author
        "lmirosevic"
      end

      def self.is_supported?(platform)
        true
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fastlane-1.104.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.103.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.102.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.101.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.100.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.99.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.98.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.97.2 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.97.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.97.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.96.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.95.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.94.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.94.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.93.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.93.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.92.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.92.0.beta2 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.92.0.beta1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.91.0 lib/fastlane/actions/ensure_git_status_clean.rb