Skip to content

Commit 66c6e10

Browse files
committed
更新 workflows
1 parent 975fe63 commit 66c6e10

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/winget.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ jobs:
3636
with:
3737
dotnet-version: '6.0.x'
3838

39+
- name: Sync winget-pkgs fork
40+
shell: pwsh
41+
env:
42+
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
43+
run: |
44+
$headers = @{ Authorization = "token $env:WINGET_TOKEN"; "User-Agent" = "VirtualDesktopSwitcher-winget-sync" }
45+
$me = (Invoke-RestMethod -Uri "https://api.github.com/user" -Headers $headers).login
46+
$upstream = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/winget-pkgs/git/refs/heads/master" -Headers $headers
47+
$body = @{ sha = $upstream.object.sha; force = $true } | ConvertTo-Json
48+
Invoke-RestMethod -Method Patch -Uri "https://api.github.com/repos/$me/winget-pkgs/git/refs/heads/master" `
49+
-Headers $headers -ContentType "application/json" -Body $body
50+
3951
- name: Submit winget PR
4052
shell: pwsh
4153
run: |

0 commit comments

Comments
 (0)