Skip to content

Commit d7720b8

Browse files
authoredMay 3, 2025··
Upgrade Issue-Labeler to v2.0.0 (#11262)
* Import v2.0.0 issue-labeler default workflows * issue-labeler workflow customization for dotnet/dotnet-api-docs
1 parent 23fe6b4 commit d7720b8

File tree

6 files changed

+286
-200
lines changed

6 files changed

+286
-200
lines changed
 

‎.github/workflows/labeler-build-predictor.yml‎

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1+
# Regularly restore the prediction models from cache to prevent cache eviction
12
name: "Labeler: Cache Retention"
23

4+
# For more information about GitHub's action cache limits and eviction policy, see:
5+
# https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
6+
37
on:
48
schedule:
59
- cron: "13 6 * * *" # 6:13 every day (arbitrary time daily)
610

711
workflow_dispatch:
12+
inputs:
13+
cache_key:
14+
description: "The cache key suffix to use for restoring the model from cache. Defaults to 'ACTIVE'."
15+
required: true
16+
default: "ACTIVE"
17+
18+
env:
19+
CACHE_KEY: ${{ inputs.cache_key || 'ACTIVE' }}
820

921
jobs:
10-
cache-retention:
11-
# Do not run the workflow on forks outside the 'dotnet' org
12-
if: ${{ github.repository_owner == 'dotnet' }}
13-
uses: dotnet/issue-labeler/.github/workflows/cache-retention.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
22+
restore-cache:
23+
# Do not automatically run the workflow on forks outside the 'dotnet' org
24+
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }}
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
type: ["issues", "pulls"]
30+
steps:
31+
- uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
32+
with:
33+
type: ${{ matrix.type }}
34+
cache_key: ${{ env.CACHE_KEY }}
35+
fail-on-cache-miss: true
Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,57 @@
1-
name: "Labeler: Predict Issue Labels"
1+
# Predict labels for Issues using a trained model
2+
name: "Labeler: Predict (Issues)"
23

34
on:
4-
# Only automatically predict area labels when issues are originally opened
5+
# Only automatically predict area labels when issues are first opened
56
issues:
67
types: opened
78

89
# Allow dispatching the workflow via the Actions UI, specifying ranges of numbers
910
workflow_dispatch:
1011
inputs:
11-
issue_numbers:
12-
description: "Issue Numbers (comma-separated list of ranges)"
13-
type: string
14-
model_cache_key:
15-
description: "The cache key suffix to use for loading the model"
16-
type: string
12+
issues:
13+
description: "Issue Numbers (comma-separated list of ranges)."
1714
required: true
18-
default: "LIVE"
15+
cache_key:
16+
description: "The cache key suffix to use for restoring the model. Defaults to 'ACTIVE'."
17+
required: true
18+
default: "ACTIVE"
19+
20+
env:
21+
# Do not allow failure for jobs triggered automatically (as this causes red noise on the workflows list)
22+
ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' }}
23+
24+
LABEL_PREFIX: "area-"
25+
THRESHOLD: 0.40
26+
DEFAULT_LABEL: "needs-area-label"
27+
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data
1928

2029
jobs:
21-
predict-issues:
22-
# Do not run the workflow on forks outside the 'dotnet' org
23-
if: ${{ github.repository_owner == 'dotnet' && (inputs.issue_numbers || github.event.issue.number) }}
30+
predict-issue-label:
31+
# Do not automatically run the workflow on forks outside the 'dotnet' org
32+
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }}
33+
runs-on: ubuntu-latest
2434
permissions:
2535
issues: write
26-
uses: dotnet/issue-labeler/.github/workflows/predict-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
27-
with:
28-
model_cache_key: ${{ inputs.model_cache_key }}
29-
issue_numbers: ${{ inputs.issue_numbers || github.event.issue.number }}
30-
label_prefix: "area-"
31-
threshold: 0.40
32-
default_label: "needs-area-label"
36+
steps:
37+
- name: "Restore issues model from cache"
38+
id: restore-model
39+
uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
40+
with:
41+
type: issues
42+
fail-on-cache-miss: ${{ env.ALLOW_FAILURE }}
43+
quiet: true
44+
45+
- name: "Predict issue labels"
46+
id: prediction
47+
if: ${{ steps.restore-model.outputs.cache-hit == 'true' }}
48+
uses: dotnet/issue-labeler/predict@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
49+
with:
50+
issues: ${{ inputs.issues || github.event.issue.number }}
51+
label_prefix: ${{ env.LABEL_PREFIX }}
52+
threshold: ${{ env.THRESHOLD }}
53+
default_label: ${{ env.DEFAULT_LABEL }}
54+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
55+
env:
56+
GITHUB_TOKEN: ${{ github.token }}
57+
continue-on-error: ${{ !env.ALLOW_FAILURE }}
Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: "Labeler: Predict Pull Labels"
1+
# Predict labels for Pull Requests using a trained model
2+
name: "Labeler: Predict (Pulls)"
23

34
on:
45
# Per to the following documentation:
@@ -13,31 +14,57 @@ on:
1314
# Only automatically predict area labels when pull requests are first opened
1415
pull_request_target:
1516
types: opened
17+
18+
# Configure the branches that need to have PRs labeled
1619
branches:
17-
- 'main'
20+
- main
1821

1922
# Allow dispatching the workflow via the Actions UI, specifying ranges of numbers
2023
workflow_dispatch:
2124
inputs:
22-
pull_numbers:
23-
description: "Pull Numbers (comma-separated list of ranges)"
24-
type: string
25-
model_cache_key:
26-
description: "The cache key suffix to use for loading the model"
27-
type: string
25+
pulls:
26+
description: "Pull Request Numbers (comma-separated list of ranges)."
27+
required: true
28+
cache_key:
29+
description: "The cache key suffix to use for restoring the model. Defaults to 'ACTIVE'."
2830
required: true
29-
default: "LIVE"
31+
default: "ACTIVE"
32+
33+
env:
34+
# Do not allow failure for jobs triggered automatically (this can block PR merge)
35+
ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' }}
36+
37+
LABEL_PREFIX: "area-"
38+
THRESHOLD: 0.40
39+
DEFAULT_LABEL: "needs-area-label"
40+
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data
3041

3142
jobs:
32-
predict-pulls:
33-
# Do not run the workflow on forks outside the 'dotnet' org
34-
if: ${{ github.repository_owner == 'dotnet' && (inputs.pull_numbers || github.event.number) }}
43+
predict-pull-label:
44+
# Do not automatically run the workflow on forks outside the 'dotnet' org
45+
if: ${{ github.event_name == 'workflow_dispatch' || github.repository_owner == 'dotnet' }}
46+
runs-on: ubuntu-latest
3547
permissions:
3648
pull-requests: write
37-
uses: dotnet/issue-labeler/.github/workflows/predict-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
38-
with:
39-
model_cache_key: ${{ inputs.model_cache_key }}
40-
pull_numbers: ${{ inputs.pull_numbers || github.event.number }}
41-
label_prefix: "area-"
42-
threshold: 0.40
43-
default_label: "needs-area-label"
49+
steps:
50+
- name: "Restore pulls model from cache"
51+
id: restore-model
52+
uses: dotnet/issue-labeler/restore@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
53+
with:
54+
type: pulls
55+
fail-on-cache-miss: ${{ env.ALLOW_FAILURE }}
56+
quiet: true
57+
58+
- name: "Predict pull labels"
59+
id: prediction
60+
if: ${{ steps.restore-model.outputs.cache-hit == 'true' }}
61+
uses: dotnet/issue-labeler/predict@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
62+
with:
63+
pulls: ${{ inputs.pulls || github.event.number }}
64+
label_prefix: ${{ env.LABEL_PREFIX }}
65+
threshold: ${{ env.THRESHOLD }}
66+
default_label: ${{ env.DEFAULT_LABEL }}
67+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
68+
env:
69+
GITHUB_TOKEN: ${{ github.token }}
70+
continue-on-error: ${{ !env.ALLOW_FAILURE }}
Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
1-
name: "Labeler: Promote Models"
1+
# Promote a model from staging to 'ACTIVE', backing up the currently 'ACTIVE' model
2+
name: "Labeler: Promotion"
23

34
on:
45
# Dispatched via the Actions UI, promotes the staged models from
5-
# a staging slot into the prediction environment
6+
# a staged slot into the prediction environment
67
workflow_dispatch:
78
inputs:
8-
promote_issues:
9+
issues:
910
description: "Issues: Promote Model"
1011
type: boolean
1112
required: true
12-
promote_pulls:
13+
pulls:
1314
description: "Pulls: Promote Model"
1415
type: boolean
1516
required: true
16-
model_cache_key:
17-
description: "The cache key suffix to promote into the 'LIVE' cache"
18-
type: string
17+
staged_key:
18+
description: "The cache key suffix to use for promoting a staged model to 'ACTIVE'. Defaults to 'staged'."
1919
required: true
20-
default: "staging"
21-
backup_cache_key:
22-
description: "The cache key suffix to use for backing up the currently promoted model"
23-
type: string
20+
default: "staged"
21+
backup_key:
22+
description: "The cache key suffix to use for backing up the currently active model. Defaults to 'backup'."
2423
default: "backup"
2524

2625
permissions:
2726
actions: write
2827

2928
jobs:
30-
labeler-promote-issues:
31-
if: ${{ inputs.promote_issues }}
32-
uses: dotnet/issue-labeler/.github/workflows/promote-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
33-
with:
34-
model_cache_key: ${{ inputs.model_cache_key }}
35-
backup_cache_key: ${{ inputs.backup_cache_key }}
29+
promote-issues:
30+
if: ${{ inputs.issues }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: "Promote Model for Issues"
34+
uses: dotnet/issue-labeler/promote@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
35+
with:
36+
type: "issues"
37+
staged_key: ${{ inputs.staged_key }}
38+
backup_key: ${{ inputs.backup_key }}
3639

37-
labeler-promote-pulls:
38-
if: ${{ inputs.promote_pulls }}
39-
uses: dotnet/issue-labeler/.github/workflows/promote-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
40-
with:
41-
model_cache_key: ${{ inputs.model_cache_key }}
42-
backup_cache_key: ${{ inputs.backup_cache_key }}
40+
promote-pulls:
41+
if: ${{ inputs.pulls }}
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: "Promote Model for Pull Requests"
45+
uses: dotnet/issue-labeler/promote@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
46+
with:
47+
type: "pulls"
48+
staged_key: ${{ inputs.staged_key }}
49+
backup_key: ${{ inputs.backup_key }}
Lines changed: 140 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,161 @@
1-
name: "Labeler: Train Models"
1+
# Train the Issues and Pull Requests models for label prediction
2+
name: "Labeler: Training"
23

34
on:
4-
# Dispatched via the Actions UI, stages new models for promotion consideration
5-
# Each step of the workflow can be run independently: Download, Train, and Test
65
workflow_dispatch:
76
inputs:
8-
download_issues:
9-
description: "Issues: Download Data"
10-
type: boolean
11-
default: true
12-
train_issues:
13-
description: "Issues: Train Model"
14-
type: boolean
15-
default: true
16-
test_issues:
17-
description: "Issues: Test Model"
18-
type: boolean
19-
default: true
20-
download_pulls:
21-
description: "Pulls: Download Data"
22-
type: boolean
23-
default: true
24-
train_pulls:
25-
description: "Pulls: Train Model"
26-
type: boolean
27-
default: true
28-
test_pulls:
29-
description: "Pulls: Test Model"
30-
type: boolean
31-
default: true
7+
type:
8+
description: "Issues or Pull Requests"
9+
type: choice
10+
required: true
11+
default: "Both"
12+
options:
13+
- "Both"
14+
- "Issues"
15+
- "Pull Requests"
3216

33-
data_limit:
34-
description: "Max number of items to include in the model"
35-
type: number
17+
steps:
18+
description: "Training Steps"
19+
type: choice
20+
required: true
21+
default: "All"
22+
options:
23+
- "All"
24+
- "Download Data"
25+
- "Train Model"
26+
- "Test Model"
3627

37-
pull_page_size:
38-
description: "Max number of pulls to download per page"
28+
limit:
29+
description: "Max number of items to download for training/testing the model (newest items are used). Defaults to the max number of pages times the page size."
30+
type: number
31+
page_size:
32+
description: "Number of items per page in GitHub API requests. Defaults to 100 for issues, 25 for pull requests."
33+
type: number
34+
page_limit:
35+
description: "Maximum number of pages to download for training/testing the model. Defaults to 1000 for issues, 4000 for pull requests."
3936
type: number
40-
default: 1
41-
4237
cache_key_suffix:
43-
description: "The cache key suffix to use for staging data/models (use 'LIVE' to bypass staging)"
44-
type: string
38+
description: "The cache key suffix to use for staged data/models (use 'ACTIVE' to bypass staging). Defaults to 'staged'."
4539
required: true
46-
default: "staging"
40+
default: "staged"
4741

48-
permissions:
49-
issues: read
50-
pull-requests: read
51-
actions: write
42+
env:
43+
CACHE_KEY: ${{ inputs.cache_key_suffix }}
44+
REPOSITORY: ${{ github.repository }}
45+
LABEL_PREFIX: "area-"
46+
THRESHOLD: "0.40"
47+
LIMIT: ${{ inputs.limit }}
48+
PAGE_SIZE: ${{ inputs.page_size }}
49+
PAGE_LIMIT: ${{ inputs.page_limit }}
50+
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data
5251

5352
jobs:
54-
# Without specifying a pageSize of 1 for downloading pull requests, the requests time out
55-
# Directly invoking the individual workflows until https://github.com/dotnet/issue-labeler/issues/97 is addressed
56-
#
57-
# labeler-train:
58-
# permissions:
59-
# issues: read
60-
# pull-requests: read
61-
# actions: write
62-
# uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
63-
# with:
64-
# download_issues: ${{ inputs.download_issues }}
65-
# train_issues: ${{ inputs.train_issues }}
66-
# test_issues: ${{ inputs.test_issues }}
67-
# download_pulls: ${{ inputs.download_pulls }}
68-
# train_pulls: ${{ inputs.train_pulls }}
69-
# test_pulls: ${{ inputs.test_pulls }}
70-
# data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
71-
# cache_key_suffix: ${{ inputs.cache_key_suffix }}
72-
# label_prefix: "area-"
73-
# threshold: 0.40
74-
75-
build-predictor:
76-
uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
77-
78-
labeler-download-issues:
79-
needs: build-predictor
80-
if: ${{ inputs.download_issues }}
53+
download-issues:
54+
if: ${{ contains(fromJSON('["Both", "Issues"]'), inputs.type) && contains(fromJSON('["All", "Download Data"]'), inputs.steps) }}
55+
runs-on: ubuntu-latest
8156
permissions:
8257
issues: read
83-
actions: write
84-
uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
85-
with:
86-
data_cache_key: ${{ inputs.cache_key_suffix }}
87-
issue_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
88-
label_prefix: "area-"
58+
steps:
59+
- name: "Download Issues"
60+
uses: dotnet/issue-labeler/download@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
61+
with:
62+
type: "issues"
63+
cache_key: ${{ env.CACHE_KEY }}
64+
repository: ${{ env.REPOSITORY }}
65+
label_prefix: ${{ env.LABEL_PREFIX }}
66+
limit: ${{ env.LIMIT }}
67+
page_size: ${{ env.PAGE_SIZE }}
68+
page_limit: ${{ env.PAGE_LIMIT }}
69+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
70+
env:
71+
GITHUB_TOKEN: ${{ github.token }}
8972

90-
labeler-train-issues:
91-
needs: labeler-download-issues
92-
if: ${{ inputs.train_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') }}
73+
download-pulls:
74+
if: ${{ contains(fromJSON('["Both", "Pull Requests"]'), inputs.type) && contains(fromJSON('["All", "Download Data"]'), inputs.steps) }}
75+
runs-on: ubuntu-latest
9376
permissions:
94-
actions: write
95-
uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
96-
with:
97-
data_cache_key: ${{ inputs.cache_key_suffix }}
98-
model_cache_key: ${{ inputs.cache_key_suffix }}
77+
pull-requests: read
78+
steps:
79+
- name: "Download Pull Requests"
80+
uses: dotnet/issue-labeler/download@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
81+
with:
82+
type: "pulls"
83+
cache_key: ${{ env.CACHE_KEY }}
84+
repository: ${{ env.REPOSITORY }}
85+
label_prefix: ${{ env.LABEL_PREFIX }}
86+
limit: ${{ env.LIMIT }}
87+
page_size: ${{ env.PAGE_SIZE }}
88+
page_limit: ${{ env.PAGE_LIMIT }}
89+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
90+
env:
91+
GITHUB_TOKEN: ${{ github.token }}
9992

100-
labeler-test-issues:
101-
needs: [labeler-download-issues, labeler-train-issues]
102-
if: ${{ inputs.test_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') && (needs.labeler-train-issues.result == 'success' || needs.labeler-train-issues.result == 'skipped') }}
103-
uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
104-
with:
105-
model_cache_key: ${{ inputs.cache_key_suffix }}
106-
label_prefix: "area-"
107-
threshold: 0.40
93+
train-issues:
94+
if: ${{ always() && contains(fromJSON('["Both", "Issues"]'), inputs.type) && contains(fromJSON('["All", "Train Model"]'), inputs.steps) && contains(fromJSON('["success", "skipped"]'), needs.download-issues.result) }}
95+
runs-on: ubuntu-latest
96+
permissions: {}
97+
needs: download-issues
98+
steps:
99+
- name: "Train Model for Issues"
100+
uses: dotnet/issue-labeler/train@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
101+
with:
102+
type: "issues"
103+
data_cache_key: ${{ env.CACHE_KEY }}
104+
model_cache_key: ${{ env.CACHE_KEY }}
108105

109-
labeler-download-pulls:
110-
needs: build-predictor
111-
if: ${{ inputs.download_pulls }}
112-
permissions:
113-
pull-requests: read
114-
actions: write
115-
uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
116-
with:
117-
data_cache_key: ${{ inputs.cache_key_suffix }}
118-
pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
119-
page_size: ${{ inputs.pull_page_size && fromJSON(inputs.pull_page_size) || 1 }}
120-
label_prefix: "area-"
106+
train-pulls:
107+
if: ${{ always() && contains(fromJSON('["Both", "Pull Requests"]'), inputs.type) && contains(fromJSON('["All", "Train Model"]'), inputs.steps) && contains(fromJSON('["success", "skipped"]'), needs.download-pulls.result) }}
108+
runs-on: ubuntu-latest
109+
permissions: {}
110+
needs: download-pulls
111+
steps:
112+
- name: "Train Model for Pull Requests"
113+
uses: dotnet/issue-labeler/train@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
114+
with:
115+
type: "pulls"
116+
data_cache_key: ${{ env.CACHE_KEY }}
117+
model_cache_key: ${{ env.CACHE_KEY }}
121118

122-
labeler-train-pulls:
123-
needs: labeler-download-pulls
124-
if: ${{ inputs.train_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') }}
119+
test-issues:
120+
if: ${{ always() && contains(fromJSON('["Both", "Issues"]'), inputs.type) && contains(fromJSON('["All", "Test Model"]'), inputs.steps) && contains(fromJSON('["success", "skipped"]'), needs.train-issues.result) }}
121+
runs-on: ubuntu-latest
125122
permissions:
126-
actions: write
127-
uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
128-
with:
129-
data_cache_key: ${{ inputs.cache_key_suffix }}
130-
model_cache_key: ${{ inputs.cache_key_suffix }}
123+
issues: read
124+
needs: train-issues
125+
steps:
126+
- name: "Test Model for Issues"
127+
uses: dotnet/issue-labeler/test@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
128+
with:
129+
type: "issues"
130+
cache_key: ${{ env.CACHE_KEY }}
131+
repository: ${{ env.REPOSITORY }}
132+
label_prefix: ${{ env.LABEL_PREFIX }}
133+
threshold: ${{ env.THRESHOLD }}
134+
limit: ${{ env.LIMIT }}
135+
page_size: ${{ env.PAGE_SIZE }}
136+
page_limit: ${{ env.PAGE_LIMIT }}
137+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
138+
env:
139+
GITHUB_TOKEN: ${{ github.token }}
131140

132-
labeler-test-pulls:
133-
needs: [labeler-download-pulls, labeler-train-pulls]
134-
if: ${{ inputs.test_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') && (needs.labeler-train-pulls.result == 'success' || needs.labeler-train-pulls.result == 'skipped') }}
135-
uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
136-
with:
137-
model_cache_key: ${{ inputs.cache_key_suffix }}
138-
label_prefix: "area-"
139-
threshold: 0.40
141+
test-pulls:
142+
if: ${{ always() && contains(fromJSON('["Both", "Pull Requests"]'), inputs.type) && contains(fromJSON('["All", "Test Model"]'), inputs.steps) && contains(fromJSON('["success", "skipped"]'), needs.train-pulls.result) }}
143+
runs-on: ubuntu-latest
144+
permissions:
145+
pull-requests: read
146+
needs: train-pulls
147+
steps:
148+
- name: "Test Model for Pull Requests"
149+
uses: dotnet/issue-labeler/test@46125e85e6a568dc712f358c39f35317366f5eed # v2.0.0
150+
with:
151+
type: "pulls"
152+
cache_key: ${{ env.CACHE_KEY }}
153+
repository: ${{ env.REPOSITORY }}
154+
label_prefix: ${{ env.LABEL_PREFIX }}
155+
threshold: ${{ env.THRESHOLD }}
156+
limit: ${{ env.LIMIT }}
157+
page_size: ${{ env.PAGE_SIZE }}
158+
page_limit: ${{ env.PAGE_LIMIT }}
159+
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
160+
env:
161+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)
Please sign in to comment.