Class: Fastlane::Actions::ReleaseNotesFromCommitsAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ReleaseNotesFromCommitsAction
- Defined in:
- lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb
Class Method Summary collapse
- .author ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .run(config) ⇒ Object
Class Method Details
.author ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 45 def self. "Piotrek Dubiel" end |
.available_options ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 29 def self. [ FastlaneCore::ConfigItem.new(key: :current_version, env_name: "", description: "Git ref of current version", optional: true, default_value: 'HEAD') ] end |
.description ⇒ Object
25 26 27 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 25 def self.description "Extracts release notes from git commit messages since last tag" end |
.is_supported?(platform) ⇒ Boolean
49 50 51 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 49 def self.is_supported?(platform) true end |
.output ⇒ Object
39 40 41 42 43 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 39 def self.output [ ['RELEASE_NOTES', 'Release notes extracted from git commits'] ] end |
.run(config) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/polidea/actions/release_notes_from_commits.rb', line 8 def self.run(config) Fastlane::Polidea.session.action_launched("release_notes_from_commits", config) current_version = config[:current_version] previous_version = sh("git describe --abbrev=0 --tags #{current_version}^").strip = sh("git log --oneline --pretty=format:'%s' #{previous_version}..#{current_version} | grep -Ev '^Merge'").strip release_notes = .split("\n").map { |note| "- #{note}" }.join("\n") UI.success "Extracted release notes:\n#{release_notes}" Actions.lane_context[SharedValues::RELEASE_NOTES] = release_notes ENV[SharedValues::RELEASE_NOTES.to_s] = release_notes Fastlane::Polidea.session.action_completed("release_notes_from_commits") release_notes end |