forked from Azure/Azure-Sentinel
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (28 loc) · 1.06 KB
/
checkAutomatedPR.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Check if Automated Pull Request
on:
workflow_call:
outputs:
isAutomatedPR:
description: "Is Automated PR"
value: ${{ jobs.checkAutomatedPR.outputs.isAutomatedPR }}
env:
BranchName: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName || github.event.pull_request.head.ref }}
jobs:
checkAutomatedPR:
runs-on: ubuntu-latest
outputs:
isAutomatedPR: ${{ steps.ValidateAutomatedPR.outputs.isAutomatedPR }}
steps:
- shell: pwsh
id: ValidateAutomatedPR
run: |
$pullRequestBranchName = "$env:BranchName"
Write-Host "Pull Request Branch Name is $pullRequestBranchName"
$isAutomatedPR = $false
if ($pullRequestBranchName -like '*automated-pr')
{
Write-Host "Skipping packaging as it is an automated pr!"
$isAutomatedPR = $true
}
Write-Output "isAutomatedPR=$isAutomatedPR" >> $env:GITHUB_OUTPUT
Write-Host "Is this Pull Request autogenerated $isAutomatedPR"