From 27ff3e9cb435e243b32b526a6d0349882c87d825 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 19 Jul 2023 09:33:41 +0200 Subject: [PATCH] Add debug message (#142) * Add debug messag * Continue on health failure * Debugging * fix path * Fix API change --- .github/workflows/health.yaml | 17 ++--------------- .github/workflows/post_summaries.yaml | 8 ++++---- pkgs/firehose/lib/src/health/health.dart | 3 +++ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/health.yaml b/.github/workflows/health.yaml index 0f719ee4..222aea66 100644 --- a/.github/workflows/health.yaml +++ b/.github/workflows/health.yaml @@ -62,11 +62,6 @@ on: default: false type: boolean required: false - save_comment: - description: Whether to save summary as markdown file - default: false - type: boolean - required: false jobs: health: @@ -103,6 +98,7 @@ jobs: - name: Check PR health if: ${{ github.event_name == 'pull_request' }} + continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_NUMBER: ${{ github.event.number }} @@ -118,20 +114,11 @@ jobs: compare-sha: ${{ github.event.pull_request.base.ref }} allow-empty: true - - name: Archive code coverage results - if: ${{ inputs.save_comment }} - uses: actions/upload-artifact@v3 - with: - name: code-coverage-report - path: output/${{ github.event.number }}/comment.md - - name: Save PR number - if: ${{ inputs.save_comment }} run: | - echo ${{ github.event.number }} > ./output/issueNumber + echo ${{ github.event.number }} > current_repo/output/issueNumber - name: Upload folder with number and markdown - if: ${{ inputs.save_comment }} uses: actions/upload-artifact@v2 with: name: output diff --git a/.github/workflows/post_summaries.yaml b/.github/workflows/post_summaries.yaml index 08430307..032f7c4e 100644 --- a/.github/workflows/post_summaries.yaml +++ b/.github/workflows/post_summaries.yaml @@ -22,7 +22,7 @@ jobs: uses: actions/github-script@6f00a0b667f9463337970371ccda9072ee86fb27 with: script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ + var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: ${{github.event.workflow_run.id }}, @@ -30,7 +30,7 @@ jobs: var matchArtifact = artifacts.data.artifacts.filter((artifact) => { return artifact.name == "output" })[0]; - var download = await github.actions.downloadArtifact({ + var download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: matchArtifact.id, @@ -53,7 +53,7 @@ jobs: if (fs.existsSync('./commentId')) { var comment_number = Number(fs.readFileSync('./commentId')); - await github.issues.updateComment({ + await github.rest.issues.updateComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: comment_number, @@ -63,7 +63,7 @@ jobs: else{ var issue_number = Number(fs.readFileSync('./issueNumber')); - await github.issues.createComment({ + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue_number, diff --git a/pkgs/firehose/lib/src/health/health.dart b/pkgs/firehose/lib/src/health/health.dart index 8b1f8e26..e507a1bb 100644 --- a/pkgs/firehose/lib/src/health/health.dart +++ b/pkgs/firehose/lib/src/health/health.dart @@ -218,11 +218,14 @@ ${isWorseThanInfo ? 'This check can be disabled by tagging the PR with `skip-${r if (existingCommentId != null) { var idFile = File('./output/commentId'); + print(''' +Saving existing comment id $existingCommentId to file ${idFile.path}'''); await idFile.create(recursive: true); await idFile.writeAsString(existingCommentId.toString()); } var commentFile = File('./output/comment.md'); + print('Saving comment markdown to file ${commentFile.path}'); await commentFile.create(recursive: true); await commentFile.writeAsString(summary);