pmt: Create separate workflow for automatic commit review

This commit is contained in:
2024-07-21 22:27:43 +03:00
committed by GitHub
parent b4b9f1d1df
commit d2e4b58ab6

35
.github/workflows/check_commits.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Check commit
on: [push]
jobs:
check-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect commit type
id: check-commit-type
run: |
echo "BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
COMM_MSG=$(git log -1 --pretty=%B)
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
if [[ "${COMM_MSG}" == *"initial"* ]]; then
echo "build_and_release=true" >> $GITHUB_ENV
else
echo "build_and_release=false" >> $GITHUB_ENV
fi
elif [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then
echo "build_and_release=true" >> $GITHUB_ENV
fi
- name: Run release workflow
id: run-rel-workflow
if: env.build_and_release == 'true'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: 'build.yml'
token: ${{ secrets.PMT_WORKFLOW_GTOKEN }}
ref: ${{ env.BRANCH }}