Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
amorde committed Oct 22, 2023
1 parent 8903401 commit cbbf398
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
bundle install --jobs=4
- name: Update index
run: |
bundle exec ruby Scripts/update-index.rb --pod "${{ inputs.pod }}" --version "${{ inputs.version }}" --action "${{ inputs.action }}" --path "${{ inputs.path }}"
bundle exec ruby Scripts/update-index.rb --sha "${{ inputs.sha }}"
# - name: Deploy to Pages
# if: github.event_name == 'schedule'
Expand All @@ -58,22 +58,10 @@ jobs:
on:
workflow_dispatch:
inputs:
pod:
description: 'The pod to be updated'
sha:
description: 'Spec repo commit SHA'
required: true
type: string
version:
description: 'The version of the pod to update'
required: true
type: string
podspec_path:
description: 'The path to the podspec in the spec repo'
required: true
type: string
action:
description: 'The action to perform'
required: true
type: string
# repository_dispatch:
# types:
# - cronjob
Expand Down
17 changes: 13 additions & 4 deletions Scripts/update-index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

options = {}
OptionParser.new do |opts|
opts.on("--pod POD_NAME", "The name of the Pod to update", String)
opts.on("--version POD_VERSION", "The version of the Pod to update", String)
opts.on("--action ACTION", "The action to perform", String)
opts.on("--path PODSPEC_PATH", "The relative path to the podspec in the master spec repo", String)
opts.on("--sha SHA", "SHA of the latest commit to the Specs repo", String)

opts.on("-h", "--help", "Prints this help") do
puts opts
Expand All @@ -21,3 +18,15 @@
STDERR.puts 'CDN Indexer v3'

puts "Options: #{options.inspect}"

exit 1 unless (sha = options[:sha])

response = REST.get("https://api.github.com/repos/CocoaPods/Specs/commits/#{sha}")
if !response.ok?
puts "Failed to fetch commit: #{sha}"
puts response.body
exit 1
end

commit_info = JSON.parse(response.body)
pp commit_info

0 comments on commit cbbf398

Please sign in to comment.