Class: Fastlane::Actions::ReleaseNotesAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/polidea/actions/release_notes.rb

Class Method Summary collapse

Class Method Details

.authorObject



33
34
35
# File 'lib/fastlane/plugin/polidea/actions/release_notes.rb', line 33

def self.author
  "Piotrek Dubiel"
end

.descriptionObject



23
24
25
# File 'lib/fastlane/plugin/polidea/actions/release_notes.rb', line 23

def self.description
  "Extracts release notes from git tag message"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/fastlane/plugin/polidea/actions/release_notes.rb', line 37

def self.is_supported?(platform)
  true
end

.outputObject



27
28
29
30
31
# File 'lib/fastlane/plugin/polidea/actions/release_notes.rb', line 27

def self.output
  [
    ['RELEASE_NOTES', 'Release notes extracted from git tag']
  ]
end

.run(config) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/polidea/actions/release_notes.rb', line 8

def self.run(config)
  Fastlane::Polidea.session.action_launched("release_notes", config)

  current_tag = sh "git describe --exact-match --tags HEAD"
  tag_info = sh "git cat-file -p #{current_tag}"
  release_notes = tag_info.split("\n").drop(5).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")

  release_notes
end