diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml index c2f61c4535..4ab3f23927 100644 --- a/.github/workflows/build_pr_documentation.yml +++ b/.github/workflows/build_pr_documentation.yml @@ -2,6 +2,15 @@ name: Build PR Documentation on: pull_request: + workflow_call: + inputs: + pr_number: + type: string + required: true + commit_sha: + type: string + required: true + concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -9,9 +18,9 @@ concurrency: jobs: build: - uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main + uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@6e2eb04a2604817c97be03786efa494fe3acae90 with: - commit_sha: ${{ github.event.pull_request.head.sha }} - pr_number: ${{ github.event.number }} + commit_sha: ${{ inputs.commit_sha || github.event.pull_request.head.sha }} + pr_number: ${{ inputs.pr_number || github.event.number }} package: transformers languages: en diff --git a/.github/workflows/pr-style-bot.yml b/.github/workflows/pr-style-bot.yml index 9ca716ec50..fdb76d8db3 100644 --- a/.github/workflows/pr-style-bot.yml +++ b/.github/workflows/pr-style-bot.yml @@ -11,9 +11,24 @@ permissions: jobs: style: - uses: huggingface/huggingface_hub/.github/workflows/style-bot-action.yml@main + uses: huggingface/huggingface_hub/.github/workflows/style-bot-action.yml@639ee721e149a281fe726a50a2cc1354b48bc463 with: python_quality_dependencies: "[quality]" style_command_type: "default" secrets: bot_token: ${{ secrets.GITHUB_TOKEN }} + + check-outputs: + runs-on: ubuntu-latest + needs: style + steps: + - run: echo ${{ needs.style.outputs.pr_number }} + - run: echo ${{ needs.style.outputs.new_commit_sha }} + + trigger: + needs: style + if: needs.style.outputs.new_commit_sha != '' + uses: "./.github/workflows/build_pr_documentation.yml" + with: + pr_number: ${{ needs.style.outputs.pr_number }} + commit_sha: ${{ needs.style.outputs.new_commit_sha }}