* [Issue-Labeler] Configure labeler-train.yml Configure the issue-labeler training workflow. - Imported the workflow template - Removed inputs, jobs, and conditions related to pull requests, as we will only use the labeler for issues in this repository * [Issue-Labeler] Configure labeler-promote.yml Configure the issue-labeler promotion workflow. - Imported the workflow template - Removed input and job for pull requests, as we will only use the labeler for issues in this repository * [Issue-Labeler] Configure labeler-predict-issues.yml Configure the issue-labeler issue prediction workflow. - Imported the workflow template - Removed the excluded_authors input * [Issue-Labeler] Configure labeler-cache-retention.yml Configure the issue-labeler cache retention workflow. - Imported the workflow template - Removed config related to pull requests, as we will only use the labeler for issues in this repository * [Issue-Labeler] Add labeler onboarding/configuration doc * Bump superlinter to v7 (via SHA) to get type:number support in GitHub workflows * Address CHECKOV lint errors in GitHub workflows * Ignore GitHub workflow files from prettier * Explicitly set workflow permissions * Comment that UTC is used for cron schedule
60 lines
2.0 KiB
YAML
60 lines
2.0 KiB
YAML
# Workflow template imported from:
|
|
# https://github.com/dotnet/.github/workflow-templates
|
|
#
|
|
# Predict labels for Issues using a trained model
|
|
name: "Labeler: Predict (Issues)"
|
|
|
|
on:
|
|
# Only automatically predict area labels when issues are first opened
|
|
issues:
|
|
types: opened
|
|
|
|
# Allow dispatching the workflow via the Actions UI, specifying ranges of numbers
|
|
workflow_dispatch:
|
|
inputs:
|
|
issues:
|
|
description: "Issue Numbers (comma-separated list of ranges)."
|
|
required: true
|
|
cache_key:
|
|
description: "The cache key suffix to use for restoring the model. Defaults to 'ACTIVE'."
|
|
required: true
|
|
default: "ACTIVE"
|
|
|
|
env:
|
|
# Do not allow failure for jobs triggered automatically (as this causes red noise on the workflows list)
|
|
ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' }}
|
|
|
|
LABEL_PREFIX: "area-"
|
|
THRESHOLD: 0.40
|
|
DEFAULT_LABEL: "needs-area-label"
|
|
|
|
permissions:
|
|
issues: write
|
|
|
|
jobs:
|
|
predict-issue-label:
|
|
# Do not automatically run the workflow on forks outside the 'dotnet' org
|
|
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Restore issues model from cache"
|
|
id: restore-model
|
|
uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
|
|
with:
|
|
type: issues
|
|
fail-on-cache-miss: ${{ env.ALLOW_FAILURE }}
|
|
quiet: true
|
|
|
|
- name: "Predict issue labels"
|
|
id: prediction
|
|
if: ${{ steps.restore-model.outputs.cache-hit == 'true' }}
|
|
uses: dotnet/issue-labeler/predict@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
|
|
with:
|
|
issues: ${{ inputs.issues || github.event.issue.number }}
|
|
label_prefix: ${{ env.LABEL_PREFIX }}
|
|
threshold: ${{ env.THRESHOLD }}
|
|
default_label: ${{ env.DEFAULT_LABEL }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
continue-on-error: ${{ !env.ALLOW_FAILURE }}
|