34 lines (31 loc) · 1.29 KB
/
getSolutionName.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
32
33
34
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