Skip to content

Add comment id

Add comment id #5

Workflow file for this run

# A CI configuration to check PR health.
name: Health
# Callers of this workflow should use it as follows:
#
# name: Health
# on:
# pull_request:
# branches: [ main ]
# types: [opened, synchronize, reopened, labeled, unlabeled]
# jobs:
# health:
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# coverage_web: true #If the coverage should run browser tests
# Callers may optionally specify the version of the SDK to use when running the
# health check. This can be useful if your package has a very recent minimum SDK
# constraint. This is done via the `sdk` input parameter. Note that this
# parameter is not required; it defaults to `stable` - using the most recent
# stable release of the Dart SDK.
#
# The checks can also be restricted to any subset of version, changelog, and license,
# if needed.
#
# jobs:
# health:
# uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
# with:
# sdk: beta
# checks: "version,changelog,license,coverage,breaking,do-not-submit"
on:
workflow_call:
inputs:
sdk:
description: >-
The channel, or a specific version from a channel, to install
('2.19.0','stable', 'beta', 'dev'). Using one of the three channels
will give you the latest version published to that channel.
default: "stable"
required: false
type: string
checks:
description: What to check for in the PR health check - any subset of "version,changelog,license,coverage,breaking,do-not-submit"
default: "version,changelog,license,coverage,breaking,do-not-submit"
type: string
required: false
fail_on:
description: Which checks should lead to failure - any subset of "version,changelog,license,coverage,breaking,do-not-submit"
default: "version,changelog,do-not-submit"
type: string
required: false
warn_on:
description: Which checks should not fail, but only warn - any subset of "version,changelog,license,coverage,breaking,do-not-submit"
default: "license,coverage,breaking"
type: string
required: false
local_debug:
description: Whether to use a local copy of package:firehose - only for debug
default: false
type: boolean
required: false
upload_coverage:
description: Whether to upload the coverage to coveralls
default: true
type: boolean
required: false
coverage_web:
description: Whether to run `dart test -p chrome` for coverage
default: false
type: boolean
required: false
use-flutter:
description: >-
Whether to setup Flutter in this workflow.
default: false
required: false
type: boolean
jobs:
version:
name: health:version
if: contains(${{ inputs.checks }}, 'version')
uses: .github/workflows/health_base.yaml

Check failure on line 86 in .github/workflows/health.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/health.yaml

Invalid workflow file

invalid value workflow reference: no version specified
with:
sdk: ${{ inputs.sdk }}
checks: version
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
changelog:
name: health:changelog
if: contains(${{ inputs.checks }}, 'changelog')
uses: .github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
checks: changelog
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
license:
name: health:license
if: contains(${{ inputs.checks }}, 'license')
uses: .github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
checks: license
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
coverage:
name: health:coverage
if: contains(${{ inputs.checks }}, 'coverage')
uses: .github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
checks: coverage
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
upload_coverage: ${{ inputs.upload_coverage }}
coverage_web: ${{ inputs.coverage_web }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
breaking:
name: health:breaking
if: contains(${{ inputs.checks }}, 'breaking')
uses: .github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
checks: breaking
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
do-not-submit:
name: health:do-not-submit
if: contains(${{ inputs.checks }}, 'do-not-submit')
uses: .github/workflows/health_base.yaml
with:
sdk: ${{ inputs.sdk }}
checks: do-not-submit
fail_on: ${{ inputs.fail_on }}
warn_on: ${{ inputs.warn_on }}
local_debug: ${{ inputs.local_debug }}
use-flutter: ${{ inputs.use-flutter }}
comment:
needs: [version, changelog, license, coverage, breaking, do-not-submit]
# These permissions are required for us to create comments on PRs.
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110
with:
path: single-comments
pattern: comment-*
merge-multiple: true
- run: ls -R single-comments
- name: Find Comment
uses: peter-evans/find-comment@
id: fc
with:
issue-number: ${{ github.event.number }}
comment-author: github-actions[bot]
body-includes: '## PR Health'
- name: Write comment id to file
if: ${{ steps.fc.outputs.comment-id == 0 }}
run: echo ${{ steps.fc.outputs.comment-id }} >> output/commentId
- name: Merge all single comments
run: |
mkdir output
echo $'## PR Health \n\n' >> output/comment.md
cat single-comments/* >> output/comment.md
echo ${{ github.event.number }} > output/issueNumber
- name: Upload folder with number and markdown
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392
with:
name: output
path: output/