Skip to content

Check commits are signed#50

Merged
stanislavHamara merged 6 commits intomainfrom
ADUI-1271-gha-checking-for-signatures
Apr 2, 2025
Merged

Check commits are signed#50
stanislavHamara merged 6 commits intomainfrom
ADUI-1271-gha-checking-for-signatures

Conversation

@stanislavHamara
Copy link
Contributor

@stanislavHamara stanislavHamara commented Apr 2, 2025

Problem Description

We would like all contributors to adhere to https://github.com/docker/vscode-extension/blob/main/CONTRIBUTING.md and sign their commits

Proposed Solution

Introduce a GHA that checks that a commit has been signed by either a "Signed-off" message or with a verified GPG, SSH, or S/MIME signature.

Proof of Work

Tested:

  • signed with GPG
  • turned off GPG and signed off in a commit message
  • removed a verified signature from a commit to trigger a GHA failure
image

Signed-off-by: Stanislav Hamara <stanislav.hamara@docker.com>
@stanislavHamara stanislavHamara force-pushed the ADUI-1271-gha-checking-for-signatures branch 2 times, most recently from 0ddac30 to 4e2e94c Compare April 2, 2025 12:23
@stanislavHamara stanislavHamara force-pushed the ADUI-1271-gha-checking-for-signatures branch from 4e2e94c to 041bfd2 Compare April 2, 2025 12:23
@stanislavHamara stanislavHamara requested a review from Copilot April 2, 2025 12:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a GitHub Actions workflow to enforce commit signature verification on pull requests according to the project's contribution guidelines.

  • Added a workflow file to trigger commit signature checks for pull requests.
  • Executes a shell script to verify commit signatures using either a GPG signature or a "Signed-off" message.
Files not reviewed (1)
  • .github/scripts/check-commits.sh: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/verify.yml:3

  • Consider adding a 'push' event trigger if commit signature verification should also be enforced on direct pushes, not only on pull requests.
  pull_request:


set -e

signoff_regex="^Signed-off-by: [A-Za-z .'-]+ <[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}>$"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rcjsuen are we happy with just checking for "Signed-off-by:"? Using regex to check for name and email makes me feel icky :D

Copy link
Collaborator

Choose a reason for hiding this comment

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

are we happy with just checking for "Signed-off-by:"?

No worries. I am okay with this as that is what we are asking for in CONTRIBUTING.md.

@stanislavHamara stanislavHamara requested a review from rcjsuen April 2, 2025 12:47

set -e

signoff_regex="^Signed-off-by: [A-Za-z .'-]+ <[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}>$"
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we happy with just checking for "Signed-off-by:"?

No worries. I am okay with this as that is what we are asking for in CONTRIBUTING.md.

@stanislavHamara stanislavHamara merged commit 32d2143 into main Apr 2, 2025
8 checks passed
@stanislavHamara stanislavHamara deleted the ADUI-1271-gha-checking-for-signatures branch April 2, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants