Skip to content

Commit

Permalink
Add debug message (#142)
Browse files Browse the repository at this point in the history
* Add debug messag

* Continue on health failure

* Debugging

* fix path

* Fix API change
  • Loading branch information
mosuem authored Jul 19, 2023
1 parent 02703ce commit 27ff3e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/post_summaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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 }},
});
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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions pkgs/firehose/lib/src/health/health.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 27ff3e9

Please sign in to comment.