chore(ci): add DCO check GitHub Action #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: DCO Check | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| dco-check: | |
| name: Verify DCO Sign-off | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Get latest commit message | |
| id: get_commit | |
| run: | | |
| message=$(git log -1 --pretty=format:"%B") | |
| echo "commit_msg<<EOF" >> $GITHUB_OUTPUT | |
| echo "$message" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Check for Signed-off-by line | |
| run: | | |
| echo " Checking commit message:" | |
| echo "${{ steps.get_commit.outputs.commit_msg }}" | |
| if [[ "${{ steps.get_commit.outputs.commit_msg }}" != *"Signed-off-by:"* ]]; then | |
| echo " DCO sign-off missing!" | |
| exit 1 | |
| else | |
| echo " DCO sign-off present." | |
| fi | |