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

Use pull_request_target for Amplify workflow #284

Merged
merged 1 commit into from
Dec 4, 2024
Merged
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
15 changes: 13 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,12 +11,23 @@ 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
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Amplify Runner
uses: amplify-security/runner-action@926f003f3c9695a93cbc4e2f1e64eb784dcacbfc # v0.2.0
Loading