cognee/.github/workflows/get_docs_changes.yml
Boris 94a674a088
feat: split document reader from chunker (#131)
* fix: abstract chunking into a separate class

* fix: yield merged text from text chunker

* fix: split python version tests

* fix: change postgres live check

* fix: remove unnecessary code

* fix: update checkout action

* fix: update setup-python action

* fix: add PG_USER env variable

* fix: make sure relationship_name is used everywhere

* fix: remove duplicate import
2024-08-19 14:36:10 +02:00

49 lines
No EOL
1.6 KiB
YAML

name: util | get docs changes
on:
workflow_call:
outputs:
changes_outside_docs:
description: "Changes outside docs"
value: ${{ jobs.get_docs_changes.outputs.changes_outside_docs }}
env:
EXCLUDED_FILE_PATTERNS: '^docs/|^README.md|^CONTRIBUTING.md|^LICENSE\.txt|\.editorconfig|\.gitignore|get_docs_changes.yml'
jobs:
get_docs_changes:
name: docs changes
runs-on: ubuntu-latest
outputs:
changes_outside_docs: ${{ steps.check_changes.outputs.changes_outside_docs }}
steps:
- name: Checkout code
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Check changes outside docs
id: check_changes
run: |
echo "base.sha: ${{ github.event.pull_request.base.sha }}"
echo "head.sha: ${{ github.event.pull_request.head.sha }}"
merge_base_sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
echo "merge_base_sha: $merge_base_sha"
changes_outside_docs=$(
git diff --name-only $merge_base_sha ${{ github.event.pull_request.head.sha }} \
| grep -vE "${{ env.EXCLUDED_FILE_PATTERNS }}" || true
)
echo $changes_outside_docs
if [ -z "$changes_outside_docs" ]; then
echo "No changes outside docs. Skipping tests."
echo "changes_outside_docs=false" >> $GITHUB_OUTPUT
else
echo "Changes detected outside docs."
echo "changes_outside_docs=true" >> $GITHUB_OUTPUT
fi