ensure_git_status_clean
Community Action Reference: Inspected directly from Fastlane core ruby gem definitions.
Supported Platforms: ios, android, mac
Raises an exception if there are uncommitted git changes
Details
A sanity check to make sure you are working in a repo that is clean.
Especially useful to put at the beginning of your Fastfile in the before_all block, if some of your other actions will touch your filesystem, do things to your git repo, or just as a general reminder to save your work.
Also needed as a prerequisite for some other actions like reset_git_repo.
Parameters & Options
Total options available: 4
| Key | Type | Env Variable | Default | Required | Description |
|---|---|---|---|---|---|
show_uncommitted_changes |
Fastlane::Boolean |
FL_ENSURE_GIT_STATUS_CLEAN_SHOW_UNCOMMITTED_CHANGES |
false |
No | The flag whether to show uncommitted changes if the repo is dirty |
show_diff |
Fastlane::Boolean |
FL_ENSURE_GIT_STATUS_CLEAN_SHOW_DIFF |
false |
No | The flag whether to show the git diff if the repo is dirty |
ignored |
String |
FL_ENSURE_GIT_STATUS_CLEAN_IGNORED_FILE |
- |
No | The handling mode of the ignored files. The available options are: 'traditional', 'none' (default) and 'matching'. Specifying 'none' to this parameter is the same as not specifying the parameter at all, which means that no ignored file will be used to check if the repo is dirty or not. Specifying 'traditional' or 'matching' causes some ignored files to be used to check if the repo is dirty or not (more info in the official docs: https://git-scm.com/docs/git-status#Documentation/git-status.txt---ignoredltmodegt) |
ignore_files |
Array |
FL_ENSURE_GIT_STATUS_CLEAN_IGNORE_FILES |
- |
No | Array of files to ignore |
Lane Context Shared Values
This action writes the following values to Actions.lane_context[SharedValues::...]:
| Key | Description |
|---|---|
SharedValues::GIT_REPO_WAS_CLEAN_ON_START |
Stores the fact that the git repo was clean at some point |
Examples
ensure_git_status_cleanSource & Upstream
- Gem Action:
ensure_git_status_clean.rb - Upstream Source: Inspect Ruby Implementation on GitHub
- Authors:
lmirosevic,antondomashnev