Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: workflow to assert changelog updates #2675

Merged
merged 10 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading