Skip to content

Commit 6dc2c8c

Browse files
committed
fix(fastlane): fastfile changes to check if local files were changed
1 parent fa2c0a8 commit 6dc2c8c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fastlane/Fastfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ end
106106

107107
lane :deploy_api_reference do
108108
sh("../tools/make-doc.sh") # dependency on Jazzy
109-
sh("cd ../build/doc && git add . && git commit -m 'update api reference' && git push") # push to gh-pages
109+
if are_doc_files_changed() # push to gh-pages if files have been changed
110+
sh("cd ../build/doc git add . && git commit -m 'update api reference' && git push")
111+
else
112+
puts "No files were changed for the api documentation, so no need to push to gh-pages"
113+
end
110114
end
111115

112116
def prepare_git(branch)
@@ -127,6 +131,11 @@ def prepare_git(branch)
127131
# git_pull
128132
end
129133

134+
def are_doc_files_changed()
135+
git_status = sh("cd ../build/doc && git status --porcelain")
136+
return !git_status.to_s.strip.empty?
137+
end
138+
130139
def prepare_api_keys()
131140
xcargs = []
132141
api_key = ENV["ALGOLIA_API_KEY"]

0 commit comments

Comments
 (0)