Skip to content

Commit

Permalink
ci: forbiden the pull request target
Browse files Browse the repository at this point in the history
  • Loading branch information
wenytang-ms committed Sep 20, 2024
1 parent 99de858 commit 589a4cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ on:
schedule:
- cron: "0 22 * * *"

pull_request_target:
pull_request:

permissions:
actions: read

jobs:
setup:
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.get-coverage == 'false' ) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx') }}
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.get-coverage == 'false' ) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx') }}
runs-on: ubuntu-latest
environment: engineering
permissions:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: List cases for pull request
id: pr-cases
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx' }}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx' }}
working-directory: packages/tests/src/e2e
run: |
cases=`find ./bot ./frontend -path "*.tests.ts" -and \
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
pnpm link --global
- name: Update CLI and legacy-peer-deps for PR cases
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx' }}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx' }}
run: |
npm install -g @microsoft/teamsapp-cli@alpha
npm config set legacy-peer-deps false
Expand Down Expand Up @@ -335,7 +335,7 @@ jobs:
permissions:
actions: write
needs: tear-down
if: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx')) && failure() && github.run_attempt < 5 }}
if: ${{ (github.event_name == 'schedule' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'teamsfx-bot/TeamsFx')) && failure() && github.run_attempt < 5 }}
runs-on: ubuntu-latest
steps:
- name: rerun
Expand Down

0 comments on commit 589a4cd

Please sign in to comment.