Skip to content

Commit 72b0592

Browse files
committed
Update git-commit implementation to use fastlane actions
As suggested in #622 (comment)
1 parent 80a7a8f commit 72b0592

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def self.run(params)
1717
return if extracted_notes_file.nil?
1818

1919
extracted_notes_file.close
20-
check_and_commit_extracted_notes_file(extracted_notes_file_path, version)
20+
commit_extracted_notes_file(extracted_notes_file_path, version)
2121
end
2222

2323
def self.extract_notes(release_notes_file_path, version)
@@ -39,9 +39,13 @@ def self.extract_notes(release_notes_file_path, version)
3939
end
4040
end
4141

42-
def self.check_and_commit_extracted_notes_file(file_path, version)
43-
Action.sh("git add #{file_path}")
44-
Action.sh("git diff-index --quiet HEAD || git commit -m \"Update draft release notes for #{version}\"")
42+
def self.commit_extracted_notes_file(file_path, version)
43+
other_action.git_add(path: file_path)
44+
other_action.git_commit(
45+
path: file_path,
46+
message: "Update draft release notes for #{version}",
47+
allow_nothing_to_commit: true
48+
)
4549
end
4650

4751
def self.description

0 commit comments

Comments
 (0)