Skip to content

Commit 76610c2

Browse files
authored
Merge pull request #197 from lae/feature/amplify-authorize-workflow
Use pull_request_target for Amplify workflow
2 parents 33a4aca + af1c30c commit 76610c2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/amplify.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Amplify Security
33
on:
4-
pull_request: {}
4+
pull_request_target: {}
55
workflow_dispatch: {}
66
push:
77
branches: ["main", "develop"]
@@ -11,12 +11,23 @@ permissions:
1111
id-token: write
1212

1313
jobs:
14+
authorize:
15+
environment:
16+
${{ github.event_name == 'pull_request_target' &&
17+
github.event.pull_request.head.repo.fork && 'external' || 'internal' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- run: true
21+
1422
amplify-security-scan:
1523
name: Amplify Security Scan
24+
needs: authorize
1625
runs-on: ubuntu-latest
17-
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
26+
if: github.actor != 'dependabot[bot]'
1827
steps:
1928
- name: Checkout
20-
uses: actions/checkout@v4
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
2132
- name: Amplify Runner
22-
uses: amplify-security/runner-action@v0.1.0
33+
uses: amplify-security/runner-action@926f003f3c9695a93cbc4e2f1e64eb784dcacbfc # v0.2.0

0 commit comments

Comments
 (0)