forked from microsoft/BCApps
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.57 KB
/
UpdatePackageVersions.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Update Package Versions
on:
workflow_dispatch:
schedule:
- cron: "55 03 * * 2" # Run at 03:55 UTC on Tuesday
defaults:
run:
shell: powershell
jobs:
GetBranches:
name: Get Branches
runs-on: windows-latest
outputs:
UpdateBranches: ${{ steps.GetBranches.outputs.UpdateBranches }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Branches
id: GetBranches
run: |
git fetch
$branches = @(git for-each-ref --format="'%(refname:short)'" refs/remotes/origin/releases/ | % { $_ -replace 'origin/', '' })
$branches += "'main'"
$branchMatrix = "[$($branches -join ',')]"
Write-Host "Updating branches: $branchMatrix"
Add-Content -Path $env:GITHUB_OUTPUT -Value "UpdateBranches=$branchMatrix"
UpdatePackageVersions:
name: "[${{ matrix.branch }}] Update Package Versions"
permissions:
contents: write
runs-on: windows-latest
environment: Official-Build
needs: GetBranches
strategy:
matrix:
branch: ${{ fromJson(needs.GetBranches.outputs.UpdateBranches) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Update Package Versions
env:
GH_TOKEN: ${{ secrets.GHTOKENWORKFLOW }}
InsiderSASToken: ${{ secrets.INSIDERSASTOKEN }}
run: |
build/scripts/UpdatePackageVersions.ps1 -Repository $ENV:GITHUB_REPOSITORY -TargetBranch ${{ matrix.branch }} -Actor $env:GITHUB_ACTOR