Skip to content

Commit

Permalink
Docs preview is only available for pull requests from the orignal rep…
Browse files Browse the repository at this point in the history
…o, not forks (#2943)

See also #2941

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
  • Loading branch information
sighingnow committed Jun 28, 2023
1 parent cab8cde commit 5b852ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v3
with:
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{github.event.pull_request.head.ref}}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: true
fetch-depth: 0

Expand All @@ -54,7 +54,7 @@ jobs:
touch ${GITHUB_WORKSPACE}/preview-the-docs.mark
- name: Leave the comment on pull request when started
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' }}
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphScope' }}
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -171,15 +171,15 @@ jobs:
fi
- name: Preview using surge
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' }}
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphScope' }}
run: |
npm install -g surge
surge ./docs/_build/latest/html \
alibaba-graphscope-build-pr-${{ github.event.number }}.surge.sh \
--token ${{ secrets.SURGE_TOKEN }}
- name: Leave the comment on pull request when succeed
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' }}
if: ${{ steps.changes.outputs.src == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphScope' }}
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -201,7 +201,7 @@ jobs:
files: "preview-the-docs.mark"

- name: Leave the comment on pull request when failed
if: ${{ failure() && steps.check_files.outputs.files_exists == 'true' }}
if: ${{ failure() && steps.check_files.outputs.files_exists == 'true' && github.event.pull_request.head.repo.full_name == 'alibaba/GraphScope' }}
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 5b852ff

Please sign in to comment.