| # 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 |
| |
| # 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" |
| |
| 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" |
| default: "version changelog license" |
| type: string |
| required: false |
| |
| jobs: |
| health: |
| # These permissions are required for us to create comments on PRs. |
| permissions: |
| pull-requests: write |
| |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab |
| - uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f |
| with: |
| sdk: ${{ inputs.sdk }} |
| |
| - name: Install firehose |
| run: dart pub global activate firehose |
| |
| - name: Validate packages |
| if: ${{ github.event_name == 'pull_request' }} |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| ISSUE_NUMBER: ${{ github.event.number }} |
| PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}" |
| run: dart pub global run firehose:health ${{ inputs.checks }} |