Skip to content

Commit 279e6dc

Browse files
committed
ci(Fastlane): manage tags with euthanticated request to GitHub
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 57e7f4e commit 279e6dc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

DesignToolbox/fastlane/Fastfile

+12-2
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,18 @@ platform :ios do
534534
puts "ℹ️ Check if '#{tag}' exists yet"
535535

536536
uri = URI("https://api.github.com/repos/#{GITHUB_ORG_REPO}/tags")
537-
response = Net::HTTP.get(uri)
538-
tags = JSON.parse(response)
537+
http = Net::HTTP.new(uri.host, uri.port)
538+
http.use_ssl = true
539+
540+
request = Net::HTTP::Get.new(uri.path)
541+
request['Accept'] = 'application/vnd.github+json'
542+
request['Authorization'] = "Bearer #{GITHUB_ACCESS_TOKEN}"
543+
request['X-GitHub-Api-Version'] = '2022-11-28'
544+
545+
response = http.request(request)
546+
tags = JSON.parse(response.body)
547+
548+
# puts tags.inspect # Uncomment for debug
539549

540550
if tags.any? { |t| t['name'] == tag }
541551
puts "ℹ️ The tag '#{tag}' still exists, won't create new tag"

0 commit comments

Comments
 (0)