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

Try using pull_request_target for the PR commenting. #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: master
pull_request:
branches: master
pull_request_target:
branches: master

env:
ONGITHUB: True
Expand Down Expand Up @@ -36,7 +38,7 @@ jobs:
make html

- name: Find Comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
uses: peter-evans/find-comment@v1
id: fc
with:
Expand All @@ -45,14 +47,14 @@ jobs:
body-includes: htmlpreview

- name: Print Comment
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
run: |
echo ${{ steps.fc.outputs.comment-id }}
echo ${{ steps.fc.outputs.comment-author }}
echo ${{ steps.fc.outputs.comment-id == ''}}

- name: Create comment
if: ${{ steps.fc.outputs.comment-id == '' && github.event_name == 'pull_request' }}
if: ${{ steps.fc.outputs.comment-id == '' && github.event_name == 'pull_request_target' }}
id: crea
uses: peter-evans/create-or-update-comment@v1
with:
Expand All @@ -71,7 +73,7 @@ jobs:

- name: Deploy the PR
shell: bash -l {0}
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request_target' }}
run: |
git config --global user.name "Github Actions"
git config --global user.email [email protected]
Expand Down