Skip to content

Commit 9747133

Browse files
committed
fix syntax
1 parent 9879095 commit 9747133

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/api_inference_generate_documentation.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,31 @@ jobs:
4040
run: pnpm run generate
4141
working-directory: ./scripts/api-inference
4242

43+
# Check changes
44+
- name: Check changes
45+
run: |
46+
git diff --name-only > changed_files.txt
47+
if grep -v -E "^(scripts/api-inference/package.json|scripts/api-inference/pnpm-lock.yaml)$" changed_files.txt | grep -q '.'; then
48+
echo "changes_detected=true" >> $GITHUB_ENV
49+
else
50+
echo "changes_detected=false" >> $GITHUB_ENV
51+
fi
52+
53+
# Skip PR if only certain files are updated
54+
- name: Skip PR creation if no meaningful changes
55+
if: env.changes_detected == 'false'
56+
run: echo "No meaningful changes. Skipping PR creation."
57+
4358
# Create or update Pull Request
4459
- name: Create Pull Request
60+
if: env.changes_detected == 'true'
4561
uses: peter-evans/create-pull-request@v7
4662
with:
4763
token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }}
4864
commit-message: Update API inference documentation (automated)
4965
branch: update-api-inference-docs-automated-pr
5066
delete-branch: true
5167
title: "[Bot] Update API inference documentation"
52-
add-paths: |
53-
**/*
54-
!scripts/api-inference/package.json
55-
!scripts/api-inference/pnpm-lock.yaml
5668
body: |
5769
This PR automatically upgrades the `@huggingface/tasks` package and regenerates the API inference documentation by running:
5870
```sh

0 commit comments

Comments
 (0)