-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Add Sigstore v2/v3 compatibility verification workflow #1725
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
Draft
morri-son
wants to merge
1
commit into
open-component-model:main
Choose a base branch
from
morri-son:feat/sigstore-verify-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+154
−0
Draft
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| name: Sigstore Verify Compatibility Test | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| v2_repository: | ||
| description: 'v2 Repository (owner/repo)' | ||
| required: true | ||
| default: 'open-component-model/ocm' | ||
| type: string | ||
| v2_ref: | ||
| description: 'v2 Reference (tag/branch/commit)' | ||
| required: true | ||
| default: 'v0.34.1' | ||
| type: string | ||
|
|
||
| v3_repository: | ||
| description: 'v3 Repository (owner/repo)' | ||
| required: true | ||
| default: 'morri-son/ocm' | ||
| type: string | ||
| v3_ref: | ||
| description: 'v3 Reference (tag/branch/commit)' | ||
| required: true | ||
| default: 'test/sigstore-v3-compatibility' | ||
| type: string | ||
|
|
||
| jobs: | ||
| verify-compatibility: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # v2 CLI verifies v2 signature | ||
| - cli_repo: ${{ inputs.v2_repository }} | ||
| cli_ref: ${{ inputs.v2_ref }} | ||
| signature_name: "sigstore-v2" | ||
| test_name: "v2_cli_verifies_v2_signature" | ||
|
|
||
| # v2 CLI verifies v3 signature | ||
| - cli_repo: ${{ inputs.v2_repository }} | ||
| cli_ref: ${{ inputs.v2_ref }} | ||
| signature_name: "sigstore-v3" | ||
| test_name: "v2_cli_verifies_v3_signature" | ||
|
|
||
| # v3 CLI verifies v2 signature | ||
| - cli_repo: ${{ inputs.v3_repository }} | ||
| cli_ref: ${{ inputs.v3_ref }} | ||
| signature_name: "sigstore-v2" | ||
| test_name: "v3_cli_verifies_v2_signature" | ||
|
|
||
| # v3 CLI verifies v3 signature | ||
| - cli_repo: ${{ inputs.v3_repository }} | ||
| cli_ref: ${{ inputs.v3_ref }} | ||
| signature_name: "sigstore-v3" | ||
| test_name: "v3_cli_verifies_v3_signature" | ||
|
|
||
| fail-fast: false | ||
|
|
||
| name: ${{ matrix.test_name }} | ||
|
|
||
| steps: | ||
| - name: Checkout Repository (for pre-signed component) | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| path: ocm-repo | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | ||
| with: | ||
| go-version: '1.25.4' | ||
|
|
||
| - name: Checkout OCM CLI | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| repository: ${{ matrix.cli_repo }} | ||
| ref: ${{ matrix.cli_ref }} | ||
| path: ocm-cli | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Build OCM CLI | ||
| run: | | ||
| echo "Building OCM CLI for verification" | ||
| echo " Repository: ${{ matrix.cli_repo }}" | ||
| echo " Reference: ${{ matrix.cli_ref }}" | ||
| cd ocm-cli | ||
| make install | ||
| ocm version | ||
|
|
||
| - name: Verify Pre-signed Component | ||
| env: | ||
| COSIGN_EXPERIMENTAL: "1" | ||
| run: | | ||
| echo "Verifying signature: ${{ matrix.signature_name }}" | ||
| echo "Using CLI: ${{ matrix.cli_repo }}@${{ matrix.cli_ref }}" | ||
|
|
||
| ocm verify cv \ | ||
| --signature ${{ matrix.signature_name }} \ | ||
| --keyless \ | ||
| ghcr.io/morri-son/ocm-test//ocm.software/sigstore-test-comp:1.0.0 | ||
|
|
||
| echo "✅ Verification successful!" | ||
|
|
||
| - name: Display Component Info | ||
| if: always() | ||
| run: | | ||
| echo "=== Component Details ===" | ||
| ocm get cv ghcr.io/morri-son/ocm-test//ocm.software/sigstore-test-comp:1.0.0 -oyaml | ||
|
|
||
| - name: Test Result Summary | ||
| if: success() | ||
| run: | | ||
| echo "✅ SUCCESS: ${{ matrix.test_name }}" | ||
| echo "" | ||
| echo "CLI:" | ||
| echo " Repository: ${{ matrix.cli_repo }}" | ||
| echo " Reference: ${{ matrix.cli_ref }}" | ||
| echo "" | ||
| echo "Signature: ${{ matrix.signature_name }}" | ||
|
|
||
| summary: | ||
| needs: verify-compatibility | ||
| runs-on: ubuntu-latest | ||
| if: always() | ||
| steps: | ||
| - name: Generate Test Summary | ||
| run: | | ||
| echo "# Sigstore Verify Compatibility Test Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Configuration" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **v2 CLI**: \`${{ inputs.v2_repository }}@${{ inputs.v2_ref }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **v3 CLI**: \`${{ inputs.v3_repository }}@${{ inputs.v3_ref }}\`" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Test Matrix" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Tests verification of pre-signed components:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **sigstore-v2**: Signed with Sigstore v2" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **sigstore-v3**: Signed with Sigstore v3" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "| CLI Version | Signature | Status |" >> $GITHUB_STEP_SUMMARY | ||
| echo "|-------------|-----------|--------|" >> $GITHUB_STEP_SUMMARY | ||
| echo "| v2 | sigstore-v2 | ${{ needs.verify-compatibility.result == 'success' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "| v2 | sigstore-v3 | ${{ needs.verify-compatibility.result == 'success' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "| v3 | sigstore-v2 | ${{ needs.verify-compatibility.result == 'success' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "| v3 | sigstore-v3 | ${{ needs.verify-compatibility.result == 'success' && '✅' || '❌' }} |" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Note" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "This workflow tests **verification only** using pre-signed components." >> $GITHUB_STEP_SUMMARY | ||
| echo "Signing tests must be performed manually due to OIDC requirements." >> $GITHUB_STEP_SUMMARY | ||
| echo "See \`.github/test-data/README.md\` for manual signing instructions." >> $GITHUB_STEP_SUMMARY | ||
|
Comment on lines
+123
to
+154
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium