Azure-Sentinel/.github/workflows/getSolutionName.yaml

35 строки
1.3 KiB
YAML

name: Get Solution Name
on:
workflow_call:
outputs:
solutionName:
description: "Solution name for the current pr"
value: ${{ jobs.currentPRSolutionName.outputs.sName }}
env:
BRANCH_NAME: ${{ github.event.client_payload.pull_request.head.ref || github.event.client_payload.pullRequestBranchName }}
jobs:
currentPRSolutionName:
name: Generate output - Solution Name
runs-on: ubuntu-latest
outputs:
sName: "${{ steps.getSolutionName.outputs.solutionName }}"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 2
ref: "${{ env.BRANCH_NAME }}"
- name: Identify Solution
shell: pwsh
id: getSolutionName
run: |
$instrumentationKey = "${{ vars.APPINSIGHTS }}"
$runId = "${{ github.run_id }}"
$pullRequestNumber = "${{ github.event.client_payload.pull_request.number && github.event.client_payload.pull_request.number || github.event.client_payload.pullRequestNumber }}"
Write-Host "pullRequestNumber $pullRequestNumber"
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module powershell-yaml
./.script/package-automation/getSolutionName.ps1 $runId $pullRequestNumber $instrumentationKey