Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/getLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* To run this file:
* * npm install @octokit/rest
* * node .github/workflows/getLabels.js
*
* This script assumes the maximum number of labels to be 100.
*/

const { Octokit } = require('@octokit/rest');
Expand All @@ -10,8 +12,14 @@ github.rest.issues
.listLabelsForRepo({
owner: 'microsoft',
repo: 'vscode-python',
per_page: 100,
})
.then((result) => {
const labels = result.data.map((label) => label.name);
console.log(JSON.stringify(labels));
console.log(
'\nNumber of labels found:',
labels.length,
", verify that it's the same as number of labels listed in https://github.com/microsoft/vscode-python/labels\n",
);
console.log(JSON.stringify(labels), '\n');
});
12 changes: 11 additions & 1 deletion .github/workflows/issue-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
# To update the list of labels, see `getLabels.js`.
REPO_LABELS: '["area-data science","area-debugging","area-diagnostics","area-editor-*","area-environments","area-formatting","area-intellisense","area-internal","area-linting","area-terminal","area-testing","author-verification-requested","bug","community ask","debt","dependencies","documentation","experimenting","feature-request","good first issue","help wanted","important","info-needed","invalid-testplan-item","investigating","iteration-candidate","iteration-plan","iteration-plan-draft","javascript","linux"]'
REPO_LABELS: '["area-data science","area-debugging","area-diagnostics","area-editor-*","area-environments","area-formatting","area-intellisense","area-internal","area-linting","area-terminal","area-testing","author-verification-requested","bug","community ask","debt","dependencies","documentation","experimenting","feature-request","good first issue","help wanted","important","info-needed","invalid-testplan-item","investigating","iteration-candidate","iteration-plan","iteration-plan-draft","javascript","linux","macos","meta","needs community feedback","needs PR","needs proposal","needs spike","no-changelog","on-testplan","partner ask","regression","release-plan","reports-wanted","skip package*.json","skip tests","tensorboard","testplan-item","triage-needed","verification-found","verification-needed","verification-steps-needed","verified","windows"]'
TRIAGERS: '["karrtikr","karthiknadig","paulacamargo25","eleanorjboyd"]'

permissions:
Expand Down Expand Up @@ -57,3 +57,13 @@ jobs:
} else {
console.log('This issue already has a "needs __", "iteration-plan", "release-plan", or the "testplan-item" label, do not add the "triage-needed" label.')
}
const knownLabels = ${{ env.REPO_LABELS }}
for( const label of labels) {
if (!knownLabels.includes(label)) {
await github.rest.issues.deleteLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: label,
})
}
}