From f21f2b5d2a99458ac67c1555c9f1025071ddbc43 Mon Sep 17 00:00:00 2001 From: Paul-Henry Kajfasz Date: Thu, 18 Jul 2024 12:17:19 +0200 Subject: [PATCH] Added changelog.yml --- .github/workflows/changelog.yml | 27 +++++++++++++++++++++++++++ .github/workflows/lint.yml | 20 -------------------- 2 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000000..86ee55cc7b --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,27 @@ +# Runs changelog related jobs. + +name: changelog + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@main + with: + fetch-depth: 0 + - name: Check if CHANGELOG.md is modified + run: | + # Get the list of changed files in the PR + changed_files=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }}) + # Check if CHANGELOG.md is in the list of changed files + if echo "$changed_files" | grep -q '^CHANGELOG.md$'; then + echo "CHANGELOG.md has been modified." + else + echo $'::warning file=CHANGELOG.md::CHANGELOG.md has not been modified.\n This warning can be ignored if is has been explicitely decided not to log changes.\n Except in this situation, make sure to add log changes.' + exit 1 + fi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7c5d443946..b06425c54e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -51,23 +51,3 @@ jobs: override: true - name: check rust versions run: ./scripts/check-rust-version.sh - - changelog: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@main - with: - fetch-depth: 0 - - name: Check if CHANGELOG.md is modified - run: | - # Get the list of changed files in the PR - changed_files=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }}) - - # Check if CHANGELOG.md is in the list of changed files - if echo "$changed_files" | grep -q '^CHANGELOG.md$'; then - echo "CHANGELOG.md has been modified." - else - echo $'::warning file=CHANGELOG.md::CHANGELOG.md has not been modified.\n This warning can be ignored if is has been explicitely decided not to log changes.\n Except in this situation, make sure to add log changes.' - exit 1 - fi