Skip to content

gh attestation verify always returns a 0 exit code #10418

@jaredlueck

Description

@jaredlueck

Describe the bug

gh attestation verify always returns a 0 exit code, even when it does not find the correct attestation.

Affected version

gh version 2.66.1 (2025-01-31)
https://github.com/cli/cli/releases/tag/v2.66.1

Steps to reproduce the behavior

#!/bin/bash

# Run a command
gh attestation verify oci://ghcr.io/repo:5.20.6 --repo repo --signer-repo signer-repo --predicate-type https://slsa.dev/provenance/v1

# Capture the exit code
exit_code=$?

# Show the exit code
echo "Exit code: $exit_code"
✗ No attestations found with predicate type: https://slsa.dev/provenance/v1
Exit code: 0

Expected vs actual behavior

Is this the intended behaviour ? I would expect to get a non-zero exit code if the command fails to find any attestations.

Metadata

Metadata

Labels

bugSomething isn't workinggh-attestationrelated to the gh attestation commandp2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions