name: docs-preview-fork on: workflow_dispatch: inputs: PR_NUMBER: type: string required: true description: "PR number (fork PR to build preview for)" COMMIT_SHA: type: string required: true description: "Full commit SHA to build" permissions: contents: read statuses: write jobs: update-initial-status: runs-on: ubuntu-latest steps: - name: Set pending commit status env: COMMIT_SHA: ${{ inputs.COMMIT_SHA }} CONTEXT_NAME: docs-preview GH_TOKEN: ${{ github.token }} GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_RUN_ID: ${{ github.run_id }} run: | gh api "repos/${GITHUB_REPOSITORY}/statuses/${COMMIT_SHA}" \ -f state=pending \ -f context="${CONTEXT_NAME}" \ -f description="Docs preview build for ${COMMIT_SHA} is running" \ -f target_url="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" deploy: uses: ./.github/workflows/docs-preview-template.yml secrets: AWS_DOCS_PR_PREVIEW_KEY_ID: ${{ secrets.AWS_DOCS_PR_PREVIEW_KEY_ID }} AWS_DOCS_PR_PREVIEW_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCS_PR_PREVIEW_SECRET_ACCESS_KEY }} needs: - update-initial-status with: PR_NUMBER: ${{ inputs.PR_NUMBER }} COMMIT_SHA: ${{ inputs.COMMIT_SHA }} STATUS_CONTEXT: docs-preview