Skip to content

Commit 0f53226

Browse files
authored
Fix Copilot Workflow to unshallow Copilot branch
1 parent 9767f1e commit 0f53226

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ jobs:
3636
with:
3737
fetch-depth: 0 # Full history needed for GitVersion
3838

39+
- name: Unshallow repository for GitVersion
40+
#if: startsWith(github.ref, 'refs/heads/copilot/')
41+
run: |
42+
Write-Host "Unshallow Copilot branch..." -ForegroundColor Green
43+
44+
Write-Host "Removing the depth limit, prune unused refs, and grab tags
45+
git fetch --prune --unshallow --tags --no-recurse-submodules
46+
47+
Write-Host "Unshallow complete." -ForegroundColor Green
48+
3949
- name: Configure PowerShell Environment
4050
shell: pwsh
4151
run: |
@@ -76,11 +86,11 @@ jobs:
7686
7787
Write-Host ".NET tools installation complete." -ForegroundColor Green
7888
79-
# - name: Verify GitVersion
80-
# shell: pwsh
81-
# run: |
82-
# Write-Host "Running GitVersion to determine semantic version..." -ForegroundColor Green
83-
# dotnet-gitversion | ConvertFrom-Json
89+
- name: Verify GitVersion
90+
shell: pwsh
91+
run: |
92+
Write-Host "Running GitVersion to determine semantic version..." -ForegroundColor Green
93+
dotnet-gitversion | ConvertFrom-Json
8494
8595
- name: Resolve Dependencies
8696
shell: pwsh
@@ -97,11 +107,6 @@ jobs:
97107
run: |
98108
Write-Host "Building SqlServerDsc module..." -ForegroundColor Green
99109
100-
# Hard-code versin due to how Coilot is switching branch (?) so gitversion fails.
101-
$ModuleVersion = '0.0.1'
102-
$env:ModuleVersion = '0.0.1'
103-
[System.Environment]::SetEnvironmentVariable('ModuleVersion','0.0.1', 'Machine')
104-
105110
# Build the module
106111
.\build.ps1 -Tasks 'build' -ErrorAction Stop
107112

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Added setup workflow for GitHub Copilot.
1111
- Switch the workflow to use Linux.
12-
- Skip verify GitVersion after install due to problem with how Copilot switches branch directly after checkout, before setup is finsihed.
13-
- Hardcode module version to 0.0.1 for the build step due to the problem with GitVersion.
12+
- Trying to unshallow the COpilot branch
1413

1514
### Changed
1615

0 commit comments

Comments
 (0)