Skip to content

Update GitHub workflows #10

Update GitHub workflows

Update GitHub workflows #10

Workflow file for this run

name: Changelog
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
jobs:
check:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Check for [skip changelog]
run: |
PR_DESCRIPTION=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body')
if echo "$PR_DESCRIPTION" | grep -q "\[skip changelog\]"; then
echo "Skip changelog found in PR description. Passing the action."
exit 0
else
exit 1
fi
- name: Check for changes in doc/CHANGES.md
if: failure()
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
FILES_CHANGED=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
if [[ "$FILES_CHANGED" == *"doc/CHANGES.md"* ]]; then
echo "doc/CHANGES.md has been modified. Passing the action."
exit 0
else
echo "doc/CHANGES.md has not been modified. Failing the action."
exit 1
fi