Skip to content

Commit

Permalink
Merge pull request #54 from fauxpark/no-fork
Browse files Browse the repository at this point in the history
Add support for `--no-fork`
  • Loading branch information
dawidd6 authored Apr 7, 2023
2 parents e9b43cd + 062981a commit d3667e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The Action will extract all needed informations by itself, you just need to spec
token: ${{secrets.TOKEN}}
# Optional, will create tap repo fork in organization
org: ORG
# Optional, use the origin repository instead of forking
no_fork: false
# Optional, defaults to homebrew/core
tap: USER/REPO
# Formula name, required
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: |
Fork tap repository to selected GitHub organization.
required: false
no_fork:
description: |
Use the origin repository instead of forking.
required: false
tap:
description: |
Formula tap.
Expand Down Expand Up @@ -81,6 +85,7 @@ runs:
HOMEBREW_GITHUB_API_TOKEN: ${{inputs.token}}
HOMEBREW_BUMP_MESSAGE: ${{inputs.message}}
HOMEBREW_BUMP_ORG: ${{inputs.org}}
HOMEBREW_BUMP_NO_FORK: ${{inputs.no_fork}}
HOMEBREW_BUMP_TAP: ${{inputs.tap}}
HOMEBREW_BUMP_FORMULA: ${{inputs.formula}}
HOMEBREW_BUMP_TAG: ${{inputs.tag}}
Expand Down
3 changes: 3 additions & 0 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def read_brew(*args)
# Get inputs
message = ENV['HOMEBREW_BUMP_MESSAGE']
org = ENV['HOMEBREW_BUMP_ORG']
no_fork = ENV['HOMEBREW_BUMP_NO_FORK']
tap = ENV['HOMEBREW_BUMP_TAP']
formula = ENV['HOMEBREW_BUMP_FORMULA']
tag = ENV['HOMEBREW_BUMP_TAG']
Expand Down Expand Up @@ -106,6 +107,7 @@ def read_brew(*args)
'--no-browse',
"--message=#{message}",
*("--fork-org=#{org}" unless org.blank?),
*("--no-fork" unless no_fork.false?),
*("--version=#{version}" unless is_git),
*("--tag=#{tag}" if is_git),
*("--revision=#{revision}" if is_git),
Expand Down Expand Up @@ -149,6 +151,7 @@ def read_brew(*args)
"--message=#{message}",
"--version=#{version}",
*("--fork-org=#{org}" unless org.blank?),
*("--no-fork" unless no_fork.false?),
*('--force' unless force.false?),
formula
rescue ErrorDuringExecution => e
Expand Down

0 comments on commit d3667e5

Please sign in to comment.