-
Notifications
You must be signed in to change notification settings - Fork 6
Cleanup #13
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
Merged
Merged
Cleanup #13
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7bed737
Use std log insteaf of fmt.printf for logging.
kommendorkapten 88fb9f1
go mod tidy
kommendorkapten c844c54
Makefile fixes
kommendorkapten 946a794
cleaned up docker and make files. Added worfklow to build and publish
kommendorkapten 897f24a
spelling error
kommendorkapten 7e9a679
spelling error
kommendorkapten a05a7cb
Set environment
kommendorkapten 1ee20e2
debug
kommendorkapten 2e6c8f3
debug pritns for actions
kommendorkapten 7820c86
more debug
kommendorkapten 5614e1a
Remove debug prints
kommendorkapten d4907fd
Lint fixes
kommendorkapten 11c1836
attest image
kommendorkapten 18e3005
lint fixes
kommendorkapten 2ad0359
only publish package from main
kommendorkapten de1ee59
Pull request feedback.
kommendorkapten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Build and push Docker image | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| attestations: write | ||
| packages: write | ||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| - name: Build and push image | ||
| id: push | ||
| uses: docker/build-push-action@v5.0.0 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
| - name: Attest | ||
| uses: actions/attest-build-provenance@v2 | ||
| id: attest | ||
| with: | ||
| subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| subject-digest: ${{ steps.push.outputs.digest }} | ||
| push-to-registry: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| package main | ||
|
|
||
| import ( | ||
| "flag" | ||
| "fmt" | ||
| "log" | ||
|
|
||
| "github.com/google/go-containerregistry/pkg/name" | ||
| "github.com/google/go-containerregistry/pkg/v1" | ||
| "github.com/google/go-containerregistry/pkg/v1/remote" | ||
| "github.com/sigstore/sigstore-go/pkg/bundle" | ||
| "github.com/sigstore/sigstore-go/pkg/verify" | ||
|
|
||
| "github.com/github/artifact-attestations-opa-provider/pkg/fetcher" | ||
| "github.com/github/artifact-attestations-opa-provider/pkg/verifier" | ||
| ) | ||
|
|
||
| var ( | ||
| img = flag.String("i", "", "image to verify") | ||
| ) | ||
|
|
||
| func main() { | ||
| var mv = &verifier.Multi{ | ||
| V: map[string]*verifier.Verifier{}, | ||
| } | ||
| var v *verifier.Verifier | ||
| var res []*verify.VerificationResult | ||
| var ref name.Reference | ||
| var remoteOpts = []remote.Option{} | ||
| var b []*bundle.Bundle | ||
| var h *v1.Hash | ||
| var err error | ||
|
|
||
| flag.Parse() | ||
|
|
||
| if *img == "" { | ||
| fmt.Println("no image provided") | ||
| } | ||
|
|
||
| if v, err = verifier.PGIVerifier(); err != nil { | ||
| log.Print(err) | ||
| } | ||
|
|
||
| mv.V[verifier.PublicGoodIssuer] = v | ||
|
|
||
| if v, err = verifier.GHVerifier(""); err != nil { | ||
| log.Print(err) | ||
| } | ||
| mv.V[verifier.GitHubIssuer] = v | ||
|
|
||
| if ref, err = name.ParseReference(*img); err != nil { | ||
| log.Print(err) | ||
| } | ||
| if b, h, err = fetcher.BundleFromName(ref, remoteOpts); err != nil { | ||
| log.Print(err) | ||
| } | ||
| if res, err = mv.Verify(b, h); err != nil { | ||
| log.Print(err) | ||
| } | ||
| for _, r := range res { | ||
| log.Printf("%+v\n", r) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.