Add Changelog with verification (#49) #147
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check | |
| # Controls when the workflow will run | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| push: | |
| branches: [ master ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| changelog: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check if CHANGELOG.md was modified | |
| run: | | |
| git fetch origin ${{ github.base_ref }} | |
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | |
| echo "$CHANGED_FILES" | |
| if ! echo "$CHANGED_FILES" | grep -q "^CHANGELOG.md$"; then | |
| echo "❌ CHANGELOG.md was not changed in Pull Request!" | |
| exit 1 | |
| fi | |
| echo "✅ CHANGELOG.md was updated." | |
| check: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '8' | |
| distribution: 'adopt' | |
| - name: Cache SBT | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.ivy2/cache | |
| ~/.sbt | |
| key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }} | |
| - name: sbt-header-check | |
| run: sbt headerCheck | |
| - name: sbt-scala-formatter-check | |
| run: sbt scalafmtCheck scalafmtSbtCheck |