fix(docs): update doc, codespaces config and GHA on commit GPG signed #3
Workflow file for this run
This file contains 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: commit-verify | |
on: | |
merge_group: | |
pull_request: | |
branches: [main] | |
types: | |
- opened | |
- synchronize | |
- edited | |
- reopened | |
jobs: | |
commit-message: | |
if: ${{ github.event_name != 'merge_group' }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: verify_commit_message | |
env: | |
TITLE: ${{ github.event.pull_request.title }} | |
run: | | |
commit_msg_type_regex='feat|fix|refactor|style|test|docs|build|tool|chore|deps' | |
commit_msg_scope_regex='.{1,20}' | |
commit_msg_subject_regex='.{1,150}' | |
commit_msg_regex="^(${commit_msg_type_regex})(\(${commit_msg_scope_regex}\))?: (${commit_msg_subject_regex})\$" | |
merge_msg_regex="^Merge branch '.+' into .+\$" | |
full_regex="(${commit_msg_regex})|(${merge_msg_regex})" | |
grep -qP "$full_regex" <<< "$TITLE" || { | |
echo "ERROR: Invalid commit message header. Please fix format of your PR title." | |
echo | |
echo "Examples of valid commits:" | |
echo 'example 1: "feat(cli): new feature"' | |
echo 'example 2: "fix(advanced-metrics): bug fix"' | |
echo 'example 3: "docs: update readme"' | |
echo | |
echo "Valid types are: $commit_msg_type_regex" | |
echo "For more details, see .github/workflows/commit-message.yaml" | |
exit 1 | |
} | |
- name: verify_commit_signing | |
run: | | |
if git log -1 --pretty=%G? | grep -q "G"; | |
then | |
echo "Commit signature verification succeeded: the latest commit is signed." | |
else | |
echo "ERROR: Commit signature verification failed: the latest commit is not signed." | |
exit 1; | |
fi |