Skip to content

Commit

Permalink
./github/workflows/signed.yaml: Create CI for checking signed commits (
Browse files Browse the repository at this point in the history
…#11)

Signed-off-by: Devansh3712 <[email protected]>
Reviewed-by: Kamoltat <[email protected]>
  • Loading branch information
Devansh3712 authored Aug 7, 2023
1 parent eccb49b commit 170d4bb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/signed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Signed Commit CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for commit trailers
run: |
chmod +x ./signed.sh
./signed.sh
shell: bash
working-directory: ./gh-actions
7 changes: 7 additions & 0 deletions gh-actions/signed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e
trailer=$(git log -1 --no-merges $commit --pretty='%B' | git interpret-trailers --parse 2>&1)
if [[ $trailer != Signed-off-by:* ]]; then
printf '%s\n' "Commit is not signed, use git commit --amend --signoff" >&2
exit 1
fi

0 comments on commit 170d4bb

Please sign in to comment.