From d8845aa9b9134973380e982bed46f7c006e8b710 Mon Sep 17 00:00:00 2001 From: Celina Hanouti Date: Wed, 11 Dec 2024 09:48:27 +0100 Subject: [PATCH 1/4] try exluding files when opening the PR --- .../api_inference_generate_documentation.yml | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/api_inference_generate_documentation.yml b/.github/workflows/api_inference_generate_documentation.yml index 644750dc5..1744d67a1 100644 --- a/.github/workflows/api_inference_generate_documentation.yml +++ b/.github/workflows/api_inference_generate_documentation.yml @@ -1,9 +1,14 @@ name: Update API Inference Documentation +# on: +# workflow_dispatch: +# schedule: +# - cron: "0 3 * * *" # Every day at 3am on: - workflow_dispatch: - schedule: - - cron: "0 3 * * *" # Every day at 3am + push: + branches: + - fix-update-doc-workflow + workflow_dispatch: # Allows manual trigger from GitHub UI concurrency: group: api_inference_generate_documentation @@ -35,23 +40,8 @@ jobs: run: pnpm run generate working-directory: ./scripts/api-inference - # Check changes - - name: Check changes - run: | - git diff --name-only > changed_files.txt - if grep -v -E "^(scripts/api-inference/package.json|scripts/api-inference/pnpm-lock.yaml)$" changed_files.txt | grep -q '.'; then - echo "changes_detected=true" >> $GITHUB_ENV - else - echo "changes_detected=false" >> $GITHUB_ENV - - # Skip PR if only certain files are updated - - name: Skip PR creation if no meaningful changes - if: env.changes_detected == 'false' - run: echo "No meaningful changes. Skipping PR creation." - # Create or update Pull Request - name: Create Pull Request - if: env.changes_detected == 'true' uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }} @@ -59,6 +49,10 @@ jobs: branch: update-api-inference-docs-automated-pr delete-branch: true title: "[Bot] Update API inference documentation" + add-paths: | + **/* + !scripts/api-inference/package.json + !scripts/api-inference/pnpm-lock.yaml body: | This PR automatically upgrades the `@huggingface/tasks` package and regenerates the API inference documentation by running: ```sh From 9879095edbea45deb339b842d21916b1f0b01ae3 Mon Sep 17 00:00:00 2001 From: Celina Hanouti Date: Wed, 11 Dec 2024 09:52:12 +0100 Subject: [PATCH 2/4] remove comment --- .github/workflows/api_inference_generate_documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api_inference_generate_documentation.yml b/.github/workflows/api_inference_generate_documentation.yml index 1744d67a1..8d7863375 100644 --- a/.github/workflows/api_inference_generate_documentation.yml +++ b/.github/workflows/api_inference_generate_documentation.yml @@ -8,7 +8,7 @@ on: push: branches: - fix-update-doc-workflow - workflow_dispatch: # Allows manual trigger from GitHub UI + workflow_dispatch: concurrency: group: api_inference_generate_documentation From 974713390368ad7134779b89cf82a32c3e0b6799 Mon Sep 17 00:00:00 2001 From: Celina Hanouti Date: Wed, 11 Dec 2024 09:58:27 +0100 Subject: [PATCH 3/4] fix syntax --- .../api_inference_generate_documentation.yml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/api_inference_generate_documentation.yml b/.github/workflows/api_inference_generate_documentation.yml index 8d7863375..ee47df43b 100644 --- a/.github/workflows/api_inference_generate_documentation.yml +++ b/.github/workflows/api_inference_generate_documentation.yml @@ -40,8 +40,24 @@ jobs: run: pnpm run generate working-directory: ./scripts/api-inference + # Check changes + - name: Check changes + run: | + git diff --name-only > changed_files.txt + if grep -v -E "^(scripts/api-inference/package.json|scripts/api-inference/pnpm-lock.yaml)$" changed_files.txt | grep -q '.'; then + echo "changes_detected=true" >> $GITHUB_ENV + else + echo "changes_detected=false" >> $GITHUB_ENV + fi + + # Skip PR if only certain files are updated + - name: Skip PR creation if no meaningful changes + if: env.changes_detected == 'false' + run: echo "No meaningful changes. Skipping PR creation." + # Create or update Pull Request - name: Create Pull Request + if: env.changes_detected == 'true' uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.TOKEN_INFERENCE_SYNC_BOT }} @@ -49,10 +65,6 @@ jobs: branch: update-api-inference-docs-automated-pr delete-branch: true title: "[Bot] Update API inference documentation" - add-paths: | - **/* - !scripts/api-inference/package.json - !scripts/api-inference/pnpm-lock.yaml body: | This PR automatically upgrades the `@huggingface/tasks` package and regenerates the API inference documentation by running: ```sh From 0268fbe52c739a4a8f8112ff2ddf8291fd2ebe63 Mon Sep 17 00:00:00 2001 From: Celina Hanouti Date: Wed, 11 Dec 2024 10:01:28 +0100 Subject: [PATCH 4/4] reactivate workflow --- .../workflows/api_inference_generate_documentation.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/api_inference_generate_documentation.yml b/.github/workflows/api_inference_generate_documentation.yml index ee47df43b..52189c28a 100644 --- a/.github/workflows/api_inference_generate_documentation.yml +++ b/.github/workflows/api_inference_generate_documentation.yml @@ -1,14 +1,10 @@ name: Update API Inference Documentation -# on: -# workflow_dispatch: -# schedule: -# - cron: "0 3 * * *" # Every day at 3am on: - push: - branches: - - fix-update-doc-workflow workflow_dispatch: + schedule: + - cron: "0 3 * * *" # Every day at 3am + concurrency: group: api_inference_generate_documentation