From 37628c8b5b9a7e573f770b499a6a85953e7af8cc Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Fri, 20 Jan 2023 18:27:58 -0600 Subject: [PATCH] fix: comment on winget PR correctly (#5789) --- .github/workflows/release.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7345481f96..aa86ec2574 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -253,6 +253,7 @@ jobs: retention-days: 7 publish-winget: + name: Publish to winget-pkgs runs-on: windows-latest needs: release steps: @@ -308,18 +309,22 @@ jobs: --submit ` --version "${version}" ` --urls "${installer_url}|X64" ` - --token "${{ secrets.CDRCI_GITHUB_TOKEN }}" + --token "$env:WINGET_GH_TOKEN" env: # For gh CLI: GH_TOKEN: ${{ github.token }} + # For wingetcreate. We need a real token since we're pushing a commit + # to GitHub and then making a PR in a different repo. + WINGET_GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} - name: Comment on PR + if: ${{ !inputs.dry_run }} run: | # Find the PR that wingetcreate just made. $version = "${{ needs.release.outputs.version }}".Trim('v') $pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${version}" --limit 1 --json number | ` - ConvertFrom-Json` + ConvertFrom-Json $pr_number = $pr_list[0].number gh pr comment --repo microsoft/winget-pkgs "${pr_number}" --body "🤖 cc: @deansheather @matifali"