mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-04-15 00:57:55 +00:00
39 lines
1.5 KiB
YAML
39 lines
1.5 KiB
YAML
name: Prowler - Merged Pull Request
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches: ['master']
|
|
types: ['closed']
|
|
|
|
jobs:
|
|
trigger-cloud-pull-request:
|
|
name: Trigger Cloud Pull Request
|
|
if: github.event.pull_request.merged == true && github.repository == 'prowler-cloud/prowler'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ github.event.pull_request.merge_commit_sha }}
|
|
|
|
- name: Set short git commit SHA
|
|
id: vars
|
|
run: |
|
|
shortSha=$(git rev-parse --short ${{ github.event.pull_request.merge_commit_sha }})
|
|
echo "SHORT_SHA=${shortSha}" >> $GITHUB_ENV
|
|
|
|
- name: Trigger pull request
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
|
|
with:
|
|
token: ${{ secrets.PROWLER_BOT_ACCESS_TOKEN }}
|
|
repository: ${{ secrets.CLOUD_DISPATCH }}
|
|
event-type: prowler-pull-request-merged
|
|
client-payload: |
|
|
{
|
|
"PROWLER_COMMIT_SHA": "${{ github.event.pull_request.merge_commit_sha }}",
|
|
"PROWLER_COMMIT_SHORT_SHA": "${{ env.SHORT_SHA }}",
|
|
"PROWLER_PR_TITLE": ${{ toJson(github.event.pull_request.title) }},
|
|
"PROWLER_PR_LABELS": ${{ toJson(github.event.pull_request.labels.*.name) }},
|
|
"PROWLER_PR_BODY": ${{ toJson(github.event.pull_request.body) }},
|
|
"PROWLER_PR_URL": ${{ toJson(github.event.pull_request.html_url) }}
|
|
}
|