name: Check Changelog

on: pull_request

jobs:
  changelog:
    runs-on: ubuntu-latest
    name: Changelog should be updated
    strategy:
      fail-fast: false
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 2

      - name: Git fetch
        run: git fetch

      - name: Check that changelog has been updated.
        run: git diff --exit-code origin/${{ github.base_ref }} -- changelog.md && exit 1 || exit 0