Skip to content

Commit 37628c8

Browse files
authored
fix: comment on winget PR correctly (#5789)
1 parent b045734 commit 37628c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/release.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ jobs:
253253
retention-days: 7
254254

255255
publish-winget:
256+
name: Publish to winget-pkgs
256257
runs-on: windows-latest
257258
needs: release
258259
steps:
@@ -308,18 +309,22 @@ jobs:
308309
--submit `
309310
--version "${version}" `
310311
--urls "${installer_url}|X64" `
311-
--token "${{ secrets.CDRCI_GITHUB_TOKEN }}"
312+
--token "$env:WINGET_GH_TOKEN"
312313
313314
env:
314315
# For gh CLI:
315316
GH_TOKEN: ${{ github.token }}
317+
# For wingetcreate. We need a real token since we're pushing a commit
318+
# to GitHub and then making a PR in a different repo.
319+
WINGET_GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
316320

317321
- name: Comment on PR
322+
if: ${{ !inputs.dry_run }}
318323
run: |
319324
# Find the PR that wingetcreate just made.
320325
$version = "${{ needs.release.outputs.version }}".Trim('v')
321326
$pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${version}" --limit 1 --json number | `
322-
ConvertFrom-Json`
327+
ConvertFrom-Json
323328
$pr_number = $pr_list[0].number
324329
325330
gh pr comment --repo microsoft/winget-pkgs "${pr_number}" --body "🤖 cc: @deansheather @matifali"

0 commit comments

Comments
 (0)