Skip to content
Open
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/pr-title-checker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"LABEL": {
"name": "title needs formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["fix: ", "feat: "],
"regexp": "docs\\(v[0-9]\\): ",
"regexpFlags": "i",
"ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
},
"MESSAGES": {
"success": "All OK",
"failure": "Failing CI test",
"notice": ""
}
}
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ on:
pull_request:

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

- name: Verify changelog updates
run: |
./scripts/check_changelog_update.sh



pr-title-checker:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lints:
name: Run linters
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions packages/ragbits-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

AAAAA

### Added

- Some new feature.
Expand Down
2 changes: 2 additions & 0 deletions packages/ragbits-core/src/ragbits/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .prompt.lab.app import lab_app
from .prompt.promptfoo import generate_configs

from base64 import *

prompts_app = typer.Typer(no_args_is_help=True)


Expand Down
33 changes: 33 additions & 0 deletions scripts/check_changelog_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

echo "Fetching main branch..."
git fetch origin main --depth=1

echo "Identifying changed files between the current branch and main branch..."
CHANGED_FILES=$(git diff --name-only origin/main | tr '\n' ' ')

if [ -z "$CHANGED_FILES" ]; then
echo "No files have been changed in this branch."
exit 0
fi

CHANGED_PACKAGES=$(echo "$CHANGED_FILES" | grep -oE 'packages/[^/]+' | cut -d '/' -f2 | sort -u)

if [ -z "$CHANGED_PACKAGES" ]; then
echo "No package changes detected. Skipping changelog check."
exit 0
fi

echo "Found changes in the following packages: $CHANGED_PACKAGES"

for PACKAGE in $CHANGED_PACKAGES; do
CHANGELOG="packages/$PACKAGE/CHANGELOG.md"
echo "Checking changelog for package: $PACKAGE"

if ! diff -u <(git show origin/main:$CHANGELOG | grep -Pzo '(?s)(## Unreleased.*?)(?=\n## |\Z)' | tr -d '\0') <(grep -Pzo '(?s)(## Unreleased.*?)(?=\n## |\Z)' $CHANGELOG | tr -d '\0') | grep -q '^\+'; then
echo "No updates detected in changelog for package $PACKAGE. Please add an entry under '## Unreleased'."
exit 1
fi
done

echo "All modified packages have their changelog updates."
Loading