Skip to content

Commit

Permalink
Merge pull request #2675 from carsakiller/log-changes
Browse files Browse the repository at this point in the history
add: workflow to assert changelog updates
  • Loading branch information
sumneko authored May 25, 2024
2 parents 87abc42 + 75ed0bf commit b79a668
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/scripts/check-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

set -e

CHANGELOG_FILE="changelog.md"

git fetch origin $GITHUB_BASE_REF
git fetch

# Check if the changelog file was modified in the PR
if git diff --name-only origin/$GITHUB_BASE_REF..remotes/pull/$GITHUB_SOURCE_REF | grep -q $CHANGELOG_FILE; then
echo "Thank you for updating the changelog!"
exit 0
else
echo "Changelog has not been updated. Please update $CHANGELOG_FILE!"
exit 1
fi
24 changes: 24 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: changelog

on:
pull_request:
types: [opened, synchronize]
branches:
- master

jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up environment
run: |
echo "GITHUB_SOURCE_REF=${{ github.ref_name }}" >> $GITHUB_ENV
echo "GITHUB_BASE_REF=${{ github.base_ref }}" >> $GITHUB_ENV
- name: Check if changelog is updated
run: .github/scripts/check-changelog.sh
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# changelog

## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->

## 3.9.0
`2024-5-11`
* `NEW` goto implementation
Expand Down Expand Up @@ -123,7 +126,7 @@
Cat = 1,
Dog = 2,
}

---@param animal userdata
---@param atp AnimalType
---@return boolean
Expand Down

0 comments on commit b79a668

Please sign in to comment.