DCO.yml 845 B

12345678910111213141516171819202122232425262728293031323334
  1. name: DCO
  2. on:
  3. push:
  4. branches: [ "main" ]
  5. pull_request:
  6. branches: [ "main" ]
  7. workflow_dispatch:
  8. env:
  9. CARGO_UNSTABLE_SPARSE_REGISTRY: true
  10. CARGO_TERM_COLOR: always
  11. jobs:
  12. check-commit-signatures:
  13. name: Check commit signatures
  14. runs-on: ubuntu-latest
  15. steps:
  16. - uses: actions/checkout@v4
  17. - name: Check if commit is signed
  18. run: |
  19. COMMIT=$(git log -1)
  20. if echo "$COMMIT" | grep -q "Author: "; then
  21. echo "Commit is signed."
  22. else
  23. echo "Commit is NOT signed."
  24. exit 1
  25. fi
  26. - name: Print author's information
  27. run: |
  28. AUTHOR_NAME=$(git log -1 --format='%an')
  29. AUTHOR_EMAIL=$(git log -1 --format='%ae')
  30. echo "Author's name: $AUTHOR_NAME"
  31. echo "Author's email: $AUTHOR_EMAIL"