Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit github workflow for documentation previews #2612

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/docs-preview-links.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
name: Docs Preview Links
name: docs-preview

on:
pull_request_target:
types: [opened]
paths:
- '**.asciidoc'
lcawl marked this conversation as resolved.
Show resolved Hide resolved
permissions:
pull-requests: write

jobs:
doc-preview:
doc-preview-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
name: Add doc preview links
- uses: elastic/docs/.github/actions/docs-preview@master
with:
script: |
const pr = context.payload.pull_request;
const comment = `Documentation preview:
- ✨ [Changed pages](https://${context.repo.repo}_${pr.number}.docs-preview.app.elstc.co/diff)`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
});
github-token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.event.repository.name }}
preview-path: 'guide/index.html'
pr: ${{ github.event.pull_request.number }}