Skip to content

Commit

Permalink
Update GitHub Actions workflow to check for CHANGELOG.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatz committed Aug 19, 2024
1 parent b8a2ec5 commit 78e1b0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
name: Check for CHANGELOG.md Update

Check failure on line 1 in .github/workflows/check-changelog.yml

View check run for this annotation

Trunk.io / Trunk Check

prettier

Incorrect formatting, autoformat by running 'trunk fmt'

permissions:
contents: read

on: [pull_request]

jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Get the list of modified files
id: changed-files
run: |
git fetch origin ${{ github.base_ref }} --depth=1
git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} > changed_files.txt
cat changed_files.txt
- name: Get the list of modified files
id: changed-files
run: |
git fetch origin ${{ github.base_ref }} --depth=1
git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} > changed_files.txt
cat changed_files.txt
- name: Check if CHANGELOG.md was updated
run: |
if ! grep -q "^CHANGELOG.md$" changed_files.txt; then
echo "::error::CHANGELOG.md was not updated!"
exit 1
else
echo "CHANGELOG.md has been updated."
fi
- name: Check if CHANGELOG.md was updated
run: |
if ! grep -q "^CHANGELOG.md$" changed_files.txt; then
echo "::error::CHANGELOG.md was not updated!"
exit 1
else
echo "CHANGELOG.md has been updated."
fi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- added documentation for color assignments in `CONTRIBUTING.md` to standardize the use of color variables in bash scripts
- added detailed color definitions and a usage example in the new "Color Assignments" section
- added Github Action to check if Pull Request contains `CHANGELOG.md` updates

---

## Latest Release
Expand Down

0 comments on commit 78e1b0e

Please sign in to comment.