Sha256: d11c467fb9484ef5884a4a33b7dffc14650f53f19b4cbd958cc5318f265e4ce0

Contents?: true

Size: 1.07 KB

Versions: 110

Compression:

Stored size: 1.07 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
          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

      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

110 entries across 110 versions & 1 rubygems

Version Path
fastlane-1.28.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.27.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.26.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.25.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.25.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.24.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.23.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.22.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.21.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.20.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.19.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.18.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.17.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.17.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.16.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.15.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.14.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.14.0 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.13.1 lib/fastlane/actions/ensure_git_status_clean.rb
fastlane-1.13.0 lib/fastlane/actions/ensure_git_status_clean.rb