forked from Azure/Azure-Sentinel
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.91 KB
/
checkSkipPackagingInfo.yaml
File metadata and controls
48 lines (45 loc) · 1.91 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# IF createPackage ATTRIBUTE IN DATA INPUT FILE IS SPECIFIED AS FALSE THEN SKIP PACKAGE CREATION ELSE DEFAULT IS CREATE PACKAGE
name: Check if packaging need to be Skipped
on:
workflow_call:
inputs:
solutionName:
required: true
type: string
outputs:
isPackagingRequired:
description: "Solution name for the current pr"
value: ${{ jobs.checkPackagingInfoStatus.outputs.isPackagingRequired }}
env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
jobs:
checkPackagingInfoStatus:
name: Check If Packaging Need to skip
runs-on: ubuntu-latest
outputs:
isPackagingRequired: ${{ steps.getPackagingSkipStatus.outputs.isPackagingRequired }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 2
ref: "${{ env.BRANCH_NAME }}"
- name: Check Skip Packaging Status
shell: pwsh
id: getPackagingSkipStatus
env:
INSTRUMENTATION_KEY: ${{ vars.APPINSIGHTS }}
RUN_ID: ${{ github.run_id }}
PULL_REQUEST_NUMBER: ${{
github.event.client_payload.pull_request.number &&
github.event.client_payload.pull_request.number ||
github.event.client_payload.pullRequestNumber }}
SOLUTION_NAME: ${{ inputs.solutionName }}
run: |
$instrumentationKey = $env:INSTRUMENTATION_KEY
$runId = $env:RUN_ID
$solutionName = $env:SOLUTION_NAME
$baseFolderPath = "/home/runner/work/Azure-Sentinel/Azure-Sentinel/"
$pullRequestNumber = $env:PULL_REQUEST_NUMBER
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module powershell-yaml
./.script/package-automation/checkSkipPackagingInfo.ps1 $solutionName $pullRequestNumber $runId $baseFolderPath $instrumentationKey