Skip to content

Commit 17e0f90

Browse files
committed
fix: checkout base branch PR
1 parent bf90119 commit 17e0f90

File tree

9 files changed

+58
-48
lines changed

9 files changed

+58
-48
lines changed

docs/installation/docusaurus.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Docusaurus project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/gatsby.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Gatsby project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/html.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ To set up the PushPreview workflow in your project:
4040
runs-on: ubuntu-latest
4141
if: github.event.label.name == 'preview'
4242
steps:
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.head_ref }}
4446
- name: Comment
4547
run: |
4648
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/hugo.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Hugo project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/jekyll.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Jekyll project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/mkdocs.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your MkDocs project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/pelican.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Pelican project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/installation/sphinx.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ To set up the PushPreview workflow in your Sphinx project:
3939
runs-on: ubuntu-latest
4040
if: github.event.label.name == 'preview'
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.head_ref }}
4345
- name: Comment
4446
run: |
4547
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."

docs/integrations/github.mdx

+34-40
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,40 @@ The [TechDocsStudio/pushpreview-action](https://github.com/TechDocsStudio/pushpr
3131
Below is an example of how to use the `push-preview-action` in a workflow:
3232

3333
```yaml
34-
name: PushPreview
35-
36-
on:
37-
pull_request_target:
38-
types:
39-
- labeled
40-
41-
jobs:
42-
preview:
43-
runs-on: ubuntu-latest
44-
if: github.event.label.name == 'preview'
45-
steps:
46-
- uses: actions/checkout@v3
47-
- name: Comment
48-
run: |
49-
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."
50-
env:
51-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
53-
- uses: actions/setup-node@v3
54-
with:
55-
node-version: 18
56-
57-
- name: Set BASE_URL
58-
run: echo "BASE_URL=/github/${{ github.repository }}/${{ github.event.number }}/" >> $GITHUB_ENV
59-
60-
# Replace with your docs build commands
61-
- name: Build site
62-
run: |
63-
cd docs
64-
yarn install --frozen-lockfile
65-
yarn build
66-
67-
- name: Generate preview
68-
uses: TechDocsStudio/[email protected]
69-
with:
70-
# Replace with your docs output directory
71-
source-directory: ./docs/build
72-
github-token: ${{ secrets.GITHUB_TOKEN }}
73-
pushpreview-token: ${{ secrets.PUSHPREVIEW_TOKEN }}
34+
name: PushPreview
35+
on:
36+
pull_request_target:
37+
types:
38+
- labeled
39+
jobs:
40+
preview:
41+
runs-on: ubuntu-latest
42+
if: github.event.label.name == 'preview'
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
ref: ${{ github.head_ref }}
47+
- name: Comment
48+
run: |
49+
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "⚙️ Hang tight! PushPreview is currently building your preview. We'll share the URL as soon as it's ready."
50+
env:
51+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- uses: actions/setup-node@v3
53+
with:
54+
node-version: 18
55+
- name: Set BASE_URL
56+
run: echo "BASE_URL=/github/${{ github.repository }}/${{ github.event.number }}/" >> $GITHUB_ENV
57+
- name: Build site
58+
run: |
59+
cd docs
60+
yarn install --frozen-lockfile
61+
yarn build
62+
- name: Generate preview
63+
uses: TechDocsStudio/[email protected]
64+
with:
65+
source-directory: ./docs/build
66+
github-token: ${{ secrets.GITHUB_TOKEN }}
67+
pushpreview-token: ${{ secrets.PUSHPREVIEW_TOKEN }}
7468
```
7569
7670
For more information on customizing the workflow to your build process, refer to the [Installation](/category/installation) section for CMS-specific guides.

0 commit comments

Comments
 (0)