From de7883c9717069b688b05637b67f99ba6a45dd61 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 14 Aug 2024 17:59:53 +0200 Subject: [PATCH] Update PR Health install instructions (#286) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per the comments in https://github.com/dart-lang/test/pull/2266. Thanks @jakemac53 ! --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
--- .github/workflows/health.yaml | 2 -- pkgs/firehose/README.md | 42 ++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/health.yaml b/.github/workflows/health.yaml index 8e95a318..69fd74e6 100644 --- a/.github/workflows/health.yaml +++ b/.github/workflows/health.yaml @@ -27,8 +27,6 @@ name: Health # coverage_web: false # upload_coverage: false # use-flutter: true -# use-flutter: true -# use-flutter: true # ignore_license: "**.g.dart" # ignore_coverage: "**.mock.dart,**.g.dart" # ignore_packages: "pkgs/helper_package" diff --git a/pkgs/firehose/README.md b/pkgs/firehose/README.md index 9ea55a51..fccca396 100644 --- a/pkgs/firehose/README.md +++ b/pkgs/firehose/README.md @@ -173,8 +173,8 @@ containing several packages). ### Integrating this tool into a repo -- copy the yaml below into a `.github/workflows/health.yaml` file in your repo -- update the target branch below if necessary (currently, `main`) +1. Copy the yaml below into a `.github/workflows/health.yaml` file in your repo +2. Update the target branch below if necessary (currently, `main`) ```yaml name: Health @@ -186,9 +186,45 @@ jobs: health: uses: dart-lang/ecosystem/.github/workflows/health.yaml@main # with: -# checks: "version,changelog,license,coverage" +# sdk: beta +# checks: "version,changelog,license,coverage,breaking,do-not-submit,leaking" +# fail_on: "version,changelog,do-not-submit" +# warn_on: "license,coverage,breaking,leaking" +# coverage_web: false +# upload_coverage: false +# use-flutter: true +# ignore_license: "**.g.dart" +# ignore_coverage: "**.mock.dart,**.g.dart" +# ignore_packages: "pkgs/helper_package" +# checkout_submodules: false +# experiments: "native-assets" + permissions: + pull-requests: write ``` +3. Copy the yaml below into a `.github/workflows/post_summaries.yaml` file in your repo. This is a [necessary](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) workaround to get PR Health comments on PRs from forks. + +```yaml +name: Comment on the pull request + +on: + # Trigger this workflow after the Health workflow completes. This workflow will have permissions to + # do things like create comments on the PR, even if the original workflow couldn't. + workflow_run: + workflows: + - Health + # - Publish + types: + - completed + +jobs: + upload: + uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main + permissions: + pull-requests: write +``` + + ### Options | Name | Type | Description | Example |