From 4a7788b44bcd15711f82b4d3a0d2df096f6cb970 Mon Sep 17 00:00:00 2001 From: Nattapon Pondongnok Date: Mon, 20 Jun 2022 14:30:25 +0700 Subject: [PATCH 1/5] [UPDATE] octokit to 4.25.0 --- Gemfile | 2 +- Gemfile.lock | 37 +++++++++++-------------------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Gemfile b/Gemfile index 05c8362..710ab78 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' ruby '~> 3.0.0' -gem "octokit", "~> 4.0" \ No newline at end of file +gem "octokit", "~> 4.25.0" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 383a830..8871857 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,40 +3,25 @@ GEM specs: addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - faraday (1.8.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday (2.3.0) + faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - multipart-post (2.1.1) - octokit (4.21.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - public_suffix (4.0.6) + faraday-net_http (2.0.3) + octokit (4.25.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) + public_suffix (4.0.7) ruby2_keywords (0.0.5) - sawyer (0.8.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) PLATFORMS arm64-darwin-20 + arm64-darwin-21 DEPENDENCIES - octokit (~> 4.0) + octokit (~> 4.25.0) RUBY VERSION ruby 3.0.2p107 From b4feea6f571e76504eac6e8912eec688c70e220c Mon Sep 17 00:00:00 2001 From: Nattapon Pondongnok Date: Mon, 20 Jun 2022 14:53:48 +0700 Subject: [PATCH 2/5] [ADD] faraday-retry v2 --- Gemfile | 3 ++- Gemfile.lock | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 710ab78..704541a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' ruby '~> 3.0.0' -gem "octokit", "~> 4.25.0" \ No newline at end of file +gem "octokit", "~> 4.25.0" +gem "faraday-retry", "~> 2.0.0" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 8871857..2ecf9fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,6 +7,8 @@ GEM faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) faraday-net_http (2.0.3) + faraday-retry (2.0.0) + faraday (~> 2.0) octokit (4.25.0) faraday (>= 1, < 3) sawyer (~> 0.9) @@ -21,6 +23,7 @@ PLATFORMS arm64-darwin-21 DEPENDENCIES + faraday-retry (~> 2.0.0) octokit (~> 4.25.0) RUBY VERSION From 48b456eac390c7ff9a41fa17de0d26e160851110 Mon Sep 17 00:00:00 2001 From: Nattapon Pondongnok Date: Mon, 20 Jun 2022 14:59:35 +0700 Subject: [PATCH 3/5] [ADD] import faraday/retry --- entrypoint.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/entrypoint.rb b/entrypoint.rb index 8ab28be..7d7de5e 100755 --- a/entrypoint.rb +++ b/entrypoint.rb @@ -7,6 +7,7 @@ require "base64" require "logger" require "optparse" +require 'faraday/retry' logger = Logger.new($stdout) logger.level = Logger::INFO @@ -58,8 +59,8 @@ raise "missing argument: -s/--sha256" unless options[:sha256] Octokit.middleware = Faraday::RackBuilder.new do |builder| - builder.use Faraday::Request::Retry, exceptions: [Octokit::ServerError] - builder.use Faraday::Response::RaiseError + builder.use Faraday::Retry, exceptions: [Octokit::ServerError] + builder.use Octokit::Response::RaiseError builder.use Octokit::Middleware::FollowRedirects builder.use Octokit::Response::FeedParser builder.response :logger, logger, log_level: :debug do |logger| From a9f8064f2ceac0437d4605071a45866141c1e564 Mon Sep 17 00:00:00 2001 From: Nattapon Pondongnok Date: Mon, 20 Jun 2022 15:08:40 +0700 Subject: [PATCH 4/5] [REMOVE] faraday interceptor --- entrypoint.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/entrypoint.rb b/entrypoint.rb index 7d7de5e..12fab52 100755 --- a/entrypoint.rb +++ b/entrypoint.rb @@ -7,7 +7,6 @@ require "base64" require "logger" require "optparse" -require 'faraday/retry' logger = Logger.new($stdout) logger.level = Logger::INFO @@ -58,17 +57,6 @@ raise "missing argument: -d/--download-url" unless options[:download_url] raise "missing argument: -s/--sha256" unless options[:sha256] - Octokit.middleware = Faraday::RackBuilder.new do |builder| - builder.use Faraday::Retry, exceptions: [Octokit::ServerError] - builder.use Octokit::Response::RaiseError - builder.use Octokit::Middleware::FollowRedirects - builder.use Octokit::Response::FeedParser - builder.response :logger, logger, log_level: :debug do |logger| - logger.filter(/(Authorization\: )(.+)/, '\1[REDACTED]') - end - builder.adapter Faraday.default_adapter - end - client = Octokit::Client.new(access_token: ENV["COMMIT_TOKEN"]) repo = client.repo(options[:repository]) From bdf1e0f0f2255a84d591350b14512e418b07d760 Mon Sep 17 00:00:00 2001 From: Nattapon Pondongnok Date: Mon, 20 Jun 2022 15:10:39 +0700 Subject: [PATCH 5/5] [UPDATE] readme version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 40bf3f0..b6b0b13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Update Homebrew Formula Actions -[![version](https://img.shields.io/badge/release-v1-blue)](https://github.com/marketplace/actions/update-homebrew-formula) +[![version](https://img.shields.io/badge/release-v1.1-blue)](https://github.com/marketplace/actions/update-homebrew-formula) > use for github actions to update homebrew formula @@ -54,7 +54,7 @@ jobs: formula: Formula/hello.rb download-url: https://github.com/example/hello/releases/download/${{ steps.get_version.outputs.version }}/hello-${{ steps.get_version.outputs.version }}-macos-x64.tar.gz sha256: xxxxxxxxxxxxx - commit-message: update hello formula + commit-message: update hello formula env: COMMIT_TOKEN: ${{ secrets.COMMIT_TOKEN }} ```