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

ratify 1.3.1 (new formula) #202677

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2610,6 +2610,7 @@ ranger
rapidfuzz-cpp
ratchet
ratfor
ratify
rattler-build
rav1e
raven
Expand Down
55 changes: 55 additions & 0 deletions Formula/r/ratify.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class Ratify < Formula
desc "Artifact Ratification Framework"
homepage "https://ratify.dev"
url "https://github.com/ratify-project/ratify/archive/refs/tags/v1.3.1.tar.gz"
sha256 "ada5c3a3c453a0552c287d0979534fb3c708bd8f41fdec83dc5378520626e339"
license "Apache-2.0"
head "https://github.com/ratify-project/ratify.git", branch: "dev"

depends_on "go" => :build

def install
ldflags = %W[
-s -w
-X github.com/ratify-project/ratify/internal/version.GitTag=#{version}
-X github.com/ratify-project/ratify/internal/version.GitCommitHash=#{tap.user}
]

system "go", "build", *std_go_args(ldflags:), "./cmd/ratify"

generate_completions_from_executable(bin/"ratify", "completion")
end

test do
assert_match version.to_s, shell_output("#{bin}/ratify version")

test_config = testpath/"ratify.json"
test_config.write <<~JSON
{
"store": {
"stores": [
{
"name": "example-artifact",
"type": "oras",
"settings": {}
}
]
},
"policy": {
"policies": []
},
"verifier": {
"verifiers": []
},
"executor": {},
"logger": {
"level": "info"
}
}
JSON

example_subject = "example.com/artifact:latest"
output = shell_output("#{bin}/ratify verify --config #{test_config} --subject #{example_subject} 2>&1", 1)
assert_match "referrer store config should have at least one store", output
end
end
Loading