|
1 | 1 | name: Update API Inference Documentation |
2 | 2 |
|
| 3 | +# on: |
| 4 | +# workflow_dispatch: |
| 5 | +# schedule: |
| 6 | +# - cron: "0 3 * * *" # Every day at 3am |
3 | 7 | on: |
4 | | - workflow_dispatch: |
5 | | - schedule: |
6 | | - - cron: "0 3 * * *" # Every day at 3am |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - fix-update-doc-workflow |
| 11 | + workflow_dispatch: # Allows manual trigger from GitHub UI |
7 | 12 |
|
8 | 13 | concurrency: |
9 | 14 | group: api_inference_generate_documentation |
@@ -35,30 +40,19 @@ jobs: |
35 | 40 | run: pnpm run generate |
36 | 41 | working-directory: ./scripts/api-inference |
37 | 42 |
|
38 | | - # Check changes |
39 | | - - name: Check changes |
40 | | - run: | |
41 | | - git diff --name-only > changed_files.txt |
42 | | - if grep -v -E "^(scripts/api-inference/package.json|scripts/api-inference/pnpm-lock.yaml)$" changed_files.txt | grep -q '.'; then |
43 | | - echo "changes_detected=true" >> $GITHUB_ENV |
44 | | - else |
45 | | - echo "changes_detected=false" >> $GITHUB_ENV |
46 | | -
|
47 | | - # Skip PR if only certain files are updated |
48 | | - - name: Skip PR creation if no meaningful changes |
49 | | - if: env.changes_detected == 'false' |
50 | | - run: echo "No meaningful changes. Skipping PR creation." |
51 | | - |
52 | 43 | # Create or update Pull Request |
53 | 44 | - name: Create Pull Request |
54 | | - if: env.changes_detected == 'true' |
55 | 45 | uses: peter-evans/create-pull-request@v7 |
56 | 46 | with: |
57 | 47 | token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }} |
58 | 48 | commit-message: Update API inference documentation (automated) |
59 | 49 | branch: update-api-inference-docs-automated-pr |
60 | 50 | delete-branch: true |
61 | 51 | title: "[Bot] Update API inference documentation" |
| 52 | + add-paths: | |
| 53 | + **/* |
| 54 | + !scripts/api-inference/package.json |
| 55 | + !scripts/api-inference/pnpm-lock.yaml |
62 | 56 | body: | |
63 | 57 | This PR automatically upgrades the `@huggingface/tasks` package and regenerates the API inference documentation by running: |
64 | 58 | ```sh |
|
0 commit comments