Skip to content

Commit

Permalink
Fixes the pull_request_target usage to avoid the secret leak issue. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sighingnow authored Jun 28, 2023
1 parent 095fdb9 commit e56bd6d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
- main
- docs
- dev/docs
pull_request_target:
pull_request:
branches:
- main
- docs
Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
steps:
- 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

- name: Generate Summary for Submodules
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Preview using netlify
uses: netlify/actions/cli@master
if: ${{ github.event_name == 'pull_request_target' }}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'v6d-io/v6d' }}
with:
args: deploy deploy --dir=docs/_build/html --alias deploy-preview-pr-${{ github.event.number }}
env:
Expand All @@ -160,7 +160,7 @@ jobs:

- name: Leave the comment on pull request
uses: actions-cool/maintain-one-comment@v3
if: ${{ github.event_name == 'pull_request_target' }}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'v6d-io/v6d' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand All @@ -170,7 +170,7 @@ jobs:

- name: Leave the comment on pull request when failed
uses: actions-cool/maintain-one-comment@v3
if: ${{ failure() && github.event_name == 'pull_request_target' }}
if: ${{ failure() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'v6d-io/v6d' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Expand Down

0 comments on commit e56bd6d

Please sign in to comment.