Skip to content

Commit

Permalink
Added changelog.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
phklive committed Jul 18, 2024
1 parent b433b57 commit f21f2b5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f21f2b5

Please sign in to comment.