File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8181 shell : pwsh
8282 run : ./eng/security-scan.ps1
8383
84- auto-tag :
85- name : Auto-increment version tag
86- if : github.ref == 'refs/heads/main' && github.event_name == 'push'
87- needs : build-test-security
88- runs-on : windows-latest
89- permissions :
90- contents : write
91- steps :
92- - uses : actions/checkout@v6
93- with :
94- fetch-depth : 0
95- fetch-tags : true
9684
97- - name : Increment and push tag
98- shell : pwsh
99- env :
100- RELEASE_TOKEN : ${{ secrets.RELEASE_TOKEN }}
101- run : |
102- git fetch --tags origin
103-
104- $latestTag = git tag --list 'v*.*.*.*' --sort=-version:refname | Select-Object -First 1
105-
106- if ([string]::IsNullOrWhiteSpace($latestTag)) {
107- $newTag = "v1.0.0.0"
108- }
109- else {
110- $parts = $latestTag.TrimStart('v') -split '\.'
111- $major = [int]$parts[0]
112- $minor = [int]$parts[1]
113- $patch = [int]$parts[2]
114- $revision = [int]$parts[3] + 1
115- $newTag = "v$major.$minor.$patch.$revision"
116- }
117-
118- git config user.name "github-actions"
119- git config user.email "github-actions@github.com"
120- git tag $newTag
121- git remote set-url origin "https://x-access-token:$env:RELEASE_TOKEN@github.com/${{ github.repository }}.git"
122- git push origin $newTag
123- Write-Host "Created and pushed tag: $newTag"
You can’t perform that action at this time.
0 commit comments