Skip to content

neuron: create 9.0.a18 to point to #3147 (files.dat sentinel value) #2220

neuron: create 9.0.a18 to point to #3147 (files.dat sentinel value)

neuron: create 9.0.a18 to point to #3147 (files.dat sentinel value) #2220

name: Commit message & PR title validation
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Get diff with base branch
id: changed-files
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} | jq -sR 'split("\n") | map(select(. != "")) | @json' | sed -r 's/^"|"$//g' | tr -s /)
echo "changed-files=\"${CHANGED_FILES}\"" >> $GITHUB_OUTPUT
- name: Validate commit messages & PR title
id: commit-message-validator
continue-on-error: true
run: |
pip install gitpython
set -x
python ./.github/workflows/validate-commit-message.py --title "${{ github.event.pull_request.title }}" --changed-files "${{ steps.changed-files.outputs.changed-files }}" --commits "${{ github.event.pull_request.commits }}"
- name: Show output
run: |
echo "Faulty commits: ${{ steps.commit-message-validator.outputs.faulty-commits }}"
echo "Script failure: ${{ steps.commit-message-validator.outputs.script-failure }}"
- name: Add comment to PR
if: ${{ steps.commit-message-validator.outputs.faulty-commits == 'true' }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: message_issues.txt
reactions: eyes, confused, rocket
- name: Fail the action
if: ${{ steps.commit-message-validator.outputs.faulty-commits == 'true' || steps.commit-message-validator.outputs.script-failure == 'true' }}
run: |
echo "Something is not right - failing"
exit 1