pmt: Create separate workflow for automatic commit review
This commit is contained in:
35
.github/workflows/check_commits.yml
vendored
Normal file
35
.github/workflows/check_commits.yml
vendored
Normal 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 }}
|
||||
Reference in New Issue
Block a user