Skip to content

Commit 544f2b2

Browse files
Multiple bug fixes for github workflow (#434)
- fixed regex which resulted in false module path and preventing integration tests - welcome message of dotnet cli is hidden from output - fixed variable for using the temporary runner path when downloading packages
1 parent f307939 commit 544f2b2

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/actions-pipeline.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
branches:
77
- trunk
8+
- feature/*
9+
- hotfix/*
810
pull_request:
911
branches:
1012
- trunk
@@ -126,11 +128,8 @@ jobs:
126128
package-stage:
127129
name: Package Management
128130
needs: build-stage
129-
# run from here only if it's not a a forked repo
130-
# head.repo.full_name would be the forked repo name and 'github.repository' is equal to our repository
131-
if: |
132-
github.event.pull_request.head.repo.full_name == github.repository ||
133-
github.ref == 'refs/heads/trunk'
131+
# run from here only if it's not a pull request
132+
if: github.event_name != 'pull_request'
134133
runs-on: ubuntu-latest
135134
steps:
136135
- name: Download module
@@ -201,7 +200,7 @@ jobs:
201200
- name: Module test installation
202201
shell: pwsh
203202
run: |
204-
./Test-InstallFromLocalFeed.ps1 -GitHubToken $env:GITHUB_TOKEN -RunnerTempPath $RUNNER_TEMP
203+
./Test-InstallFromLocalFeed.ps1 -GitHubToken $env:GITHUB_TOKEN -RunnerTempPath '${{ runner.temp }}'
205204
env:
206205
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
207206
working-directory: './tools/scripts'

tools/scripts/Test-InstallFromLocalFeed.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ param (
2121
$LocalPSGallery = "LocalPSGallery"
2222
$moduleName = "VSTeam"
2323

24+
# turn of first time experience which shows verbose uneeded text in every job
25+
$env:DOTNET_NOLOGO = $true
26+
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = $true
27+
2428
Write-Host "`n##### Download module and all it's dependencies"
2529
dotnet nuget add source --username USERNAME --password $GitHubToken --store-password-in-clear-text --name GitHub-VSTeam "https://nuget.pkg.github.com/MethodsAndPractices/index.json"
2630
nuget install $moduleName -Source GitHub-VSTeam -OutputDirectory "$RunnerTempPath/install"
2731

28-
2932
# rename folders by removing version tag from the folder name
3033
$moduleFolders = Get-ChildItem "$RunnerTempPath/install" -Directory
3134
$modulesToPublish = @()
3235
New-Item -Path "$RunnerTempPath/repo" -Type Directory | Out-Null
3336
foreach ($folder in $moduleFolders) {
34-
$shortName = $folder.Name -replace '(.*)(\.\d+){3,4}', '$1'
37+
$shortName = $folder.Name -replace '((\.\d+){3,4})', ''
3538
Move-Item -Path "$RunnerTempPath/install/$($folder.Name)" -Destination "$RunnerTempPath/install/$($shortName)"
3639
$modulesToPublish += $shortName
3740
}

0 commit comments

Comments
 (0)