From 9a1b3f24d35f1c41733d81a8c1aeb079db4324a0 Mon Sep 17 00:00:00 2001 From: Brian Sam-Bodden Date: Sat, 16 May 2026 13:40:15 -0700 Subject: [PATCH] ci: fix badge workflow PR comment permissions --- .github/workflows/mfcqi-badge.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mfcqi-badge.yml b/.github/workflows/mfcqi-badge.yml index c44577b..8dc92a1 100644 --- a/.github/workflows/mfcqi-badge.yml +++ b/.github/workflows/mfcqi-badge.yml @@ -16,6 +16,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: write # Required for git push to update badge file + issues: write # Required for PR comments + pull-requests: write steps: - uses: actions/checkout@v3 @@ -101,9 +103,13 @@ jobs: const emoji = status === 'passing' ? '✅' : '⚠️'; const trendEmoji = arrow === '↑' ? '📈' : arrow === '↓' ? '📉' : '➡️'; - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `## ${emoji} MFCQI Score: ${score} ${arrow} ${deltaFormatted}\n\n${trendEmoji} **Previous:** ${oldScore}\n\nCode quality ${status === 'passing' ? 'meets' : 'does not meet'} the minimum threshold (0.70).` - }) \ No newline at end of file + try { + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `## ${emoji} MFCQI Score: ${score} ${arrow} ${deltaFormatted}\n\n${trendEmoji} **Previous:** ${oldScore}\n\nCode quality ${status === 'passing' ? 'meets' : 'does not meet'} the minimum threshold (0.70).` + }); + } catch (error) { + core.warning(`Unable to post MFCQI PR comment: ${error.message}`); + }