Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
27 changes: 27 additions & 0 deletions .github/workflows/approval-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Approval Gate

on:
workflow_call:
inputs:
environment-name:
description: 'Environment name for approval'
required: false
type: string
default: 'external-contributor-approval'

jobs:
approval-gate:
runs-on: ubuntu-latest
environment: ${{
(github.event_name == 'pull_request_target' &&
!contains(fromJSON('["MEMBER", "OWNER"]'), github.event.pull_request.author_association))
&& inputs.environment-name
|| ''
}}
steps:
- name: Approval status
run: |
echo "Event: ${{ github.event_name }}"
echo "Author association: ${{ github.event.pull_request.author_association }}"
echo "Approval granted or not required"

5 changes: 4 additions & 1 deletion .github/workflows/build-test-push-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ permissions:
id-token: write
pull-requests: write
on:
pull_request: {}
pull_request_target: {}
push:
branches:
- main
- develop
jobs:
approval-gate:
uses: ./.github/workflows/approval-gate.yml
check-formating:
runs-on: ubuntu-latest
needs: approval-gate
steps:
- uses: actions/checkout@v2
- name: Dotenv Action
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/distroless-build-test-push-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ permissions:
id-token: write
pull-requests: write
on:
pull_request: {}
pull_request_target: {}
push:
branches:
- main
- develop
jobs:
approval-gate:
uses: ./.github/workflows/approval-gate.yml
check-formating:
runs-on: ubuntu-latest
needs: approval-gate
steps:
- uses: actions/checkout@v2
- name: Dotenv Action
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/prodsec-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ permissions:
packages: write
pull-requests: write
on:
pull_request: {}
pull_request_target: {}
push:
branches:
- main
- develop
jobs:
approval-gate:
uses: ./.github/workflows/approval-gate.yml
semgrep:
needs: approval-gate
name: Semgrep Scanner
runs-on: ubuntu-24.04
env:
Expand All @@ -32,7 +35,7 @@ jobs:
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Run FOSSA Test
- name: Run FOSSA Test
uses: fossas/fossa-action@main
with:
api-key: ${{secrets.FOSSA_API_TOKEN}}