diff options
| author | sintjuri <[email protected]> | 2026-05-29 23:11:53 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-05-29 23:11:53 +0300 |
| commit | 687d9d4ba1385643550079df028feea2bb5832cd (patch) | |
| tree | 7de15bb38ef5065a575b21f7684103da41fdc809 | |
| parent | fc2558d7cb2c6065a8dd5230e4d72b929c4834d9 (diff) | |
Update docs_build.yaml (#41866)
Co-authored-by: naspirato <[email protected]>
Co-authored-by: Cursor <[email protected]>
| -rw-r--r-- | .github/workflows/docs_build.yaml | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/.github/workflows/docs_build.yaml b/.github/workflows/docs_build.yaml index b4f58b7a839..7218a6bdae8 100644 --- a/.github/workflows/docs_build.yaml +++ b/.github/workflows/docs_build.yaml @@ -4,9 +4,16 @@ on: pull_request_target: paths: - 'ydb/docs/**' + workflow_dispatch: + inputs: + pull_number: + description: 'Pull Request number to build documentation' + required: true + type: string jobs: add-label: + if: github.event_name == 'pull_request_target' runs-on: ubuntu-latest permissions: contents: read @@ -17,26 +24,34 @@ jobs: with: script: | github.rest.issues.addLabels({ - issue_number: context.issue.number, + issue_number: context.payload.pull_request.number, owner: context.repo.owner, repo: context.repo.repo, labels: ['documentation'] }) build-docs: - needs: add-label + if: | + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request_target' && + github.event.pull_request.state == 'open') concurrency: - group: docs-build-${{ github.event.pull_request.number }} + group: docs-build-${{ github.event_name == 'workflow_dispatch' && inputs.pull_number || github.event.pull_request.number }} cancel-in-progress: true runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/pull/{0}/head', inputs.pull_number) || github.event.pull_request.head.sha }} + + - name: Get commit SHA + id: sha + run: echo "value=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + - name: Build uses: diplodoc-platform/docs-build-action@v3 with: - revision: "pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}" + revision: "pr-${{ github.event_name == 'workflow_dispatch' && inputs.pull_number || github.event.pull_request.number }}-${{ steps.sha.outputs.value }}" src-root: "./ydb/docs" cli-version: stable |
