Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,18 @@ jobs:
cache: true
- name: Check docs
run: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps

check-signed-commits:
name: Check signed commits
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Verify all commits are GPG signed
run: ./ci/check-signed-commits.sh "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd rather have the bash call here instead of a new file, if it's only being used here, such as:

"$(git log --pretty='format:%G?' -1 HEAD)" = "N"  ] && \
       echo "\nERROR: unsigned commit: BDK requires that commits be signed." || \
       true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EliteCoder18 you can see how i did here: oleonardolima@9748220

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you'd rather keep the simpler version of the file, it could be used in the justfile check command too.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! the justfile already uses a similar one-liner for local development, but intentionally with || true so it acts as a warning rather than blocking contributors mid-flow.

For CI, I feel the goal is stricter enforcement across the entire PR range (base_sha..head_sha), not just the latest commit. An inline HEAD check could miss cases where only the most recent commit is signed while earlier commits are not.

That said, I like the idea of reusing the same logic in the justfile as well, and I'm happy to wire the script into the local check recipe if you think that would be beneficial.

# test: verify unsigned commit detection

26 changes: 26 additions & 0 deletions ci/check-signed-commits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -euo pipefail

BASE_SHA="${1:-}"
HEAD_SHA="${2:-}"

if [ -z "$BASE_SHA" ] || [ -z "$HEAD_SHA" ]; then
echo "Usage: $0 <base_sha> <head_sha>"
exit 1
fi

UNSIGNED=0
while IFS=' ' read -r commit status; do
if [ "$status" = "N" ]; then
echo "Commit $commit is not GPG signed."
UNSIGNED=$((UNSIGNED + 1))
fi
done < <(git log --format="%H %G?" "${BASE_SHA}..${HEAD_SHA}")

if [ "$UNSIGNED" -gt 0 ]; then
echo "Error: $UNSIGNED commit(s) are not GPG signed. See CONTRIBUTING.md."
exit 1
fi

echo "All commits are GPG signed."
Loading