From 2e2aece0fbd00afdbafc71300b5958bca623d6f1 Mon Sep 17 00:00:00 2001 From: Filipe Constantinov Menezes Date: Wed, 4 Dec 2024 11:01:20 +0000 Subject: [PATCH] chore: update code-coverage to use apix-bot and make sticky comments (#3449) --- .github/workflows/code-health.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index 4cc3784e93..81246ec651 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -139,18 +139,18 @@ jobs: echo "| | Difference | ${diff}% |" } > comment.md cat "comment.md" >> "$GITHUB_STEP_SUMMARY" + - name: set Apix Bot token + id: app-token + uses: mongodb/apix-action/token@v4 + with: + app-id: ${{ secrets.APIXBOT_APP_ID }} + private-key: ${{ secrets.APIXBOT_APP_PEM }} - name: Comment PR - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const comment = fs.readFileSync('comment.md', 'utf8'); - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: comment - }); + uses: marocchino/sticky-pull-request-comment@v2.9.0 + with: + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + recreate: true + path: comment.md - name: Check coverage threshold run: | if (( $(echo "${{ steps.compare.outputs.diff }} < 0" | bc -l) )); then