Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attestations: widen the beta #17692

Merged
merged 4 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
core: false
cask: false
test-bot: false
token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Bundler RubyGems
uses: actions/cache@v4
Expand Down Expand Up @@ -85,6 +86,7 @@ jobs:
core: true
cask: true
test-bot: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Bundler RubyGems
uses: actions/cache@v4
Expand Down
10 changes: 10 additions & 0 deletions Library/Homebrew/attestation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ class InvalidAttestationError < RuntimeError; end
# @api private
class GhAuthNeeded < RuntimeError; end

# Returns whether attestation verification is enabled.
#
# @api private
sig { returns(T::Boolean) }
def self.enabled?
Homebrew::EnvConfig.verify_attestations? \
|| Homebrew::EnvConfig.developer? \
|| Homebrew::Settings.read("devcmdrun") == "true"
end

# Returns a path to a suitable `gh` executable for attestation verification.
#
# @api private
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ def downloader
def pour
# We skip `gh` to avoid a bootstrapping cycle, in the off-chance a user attempts
# to explicitly `brew install gh` without already having a version for bootstrapping.
if Homebrew::EnvConfig.verify_attestations? && formula.tap&.core_tap? && formula.name != "gh"
if Homebrew::Attestation.enabled? && formula.tap&.core_tap? && formula.name != "gh"
ohai "Verifying attestation for #{formula.name}"
begin
Homebrew::Attestation.check_core_attestation formula.bottle
Expand Down
Loading