Skip to content

Commit

Permalink
[actions] use pull_request_target for amplify workflow
Browse files Browse the repository at this point in the history
set environment to "external for forks, which is configured to require approval
in the repository settings
  • Loading branch information
lae committed Dec 4, 2024
1 parent 4d8e994 commit 1217fe0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/amplify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Amplify Security
on:
pull_request: {}
pull_request_target: {}
workflow_dispatch: {}
push:
branches: ["main", "develop"]
Expand All @@ -11,10 +11,19 @@ permissions:
id-token: write

jobs:
authorize:
environment:
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

amplify-security-scan:
name: Amplify Security Scan
needs: authorize
runs-on: ubuntu-latest
if: (!github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]')
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down

0 comments on commit 1217fe0

Please sign in to comment.