mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 04:27:34 +00:00
Move the allowed Matchconfig keys into a constant
This commit is contained in:
@@ -25,6 +25,8 @@ export type MatchConfig = {
|
|||||||
|
|
||||||
type ClientType = ReturnType<typeof github.getOctokit>;
|
type ClientType = ReturnType<typeof github.getOctokit>;
|
||||||
|
|
||||||
|
const ALLOWED_CONFIG_KEYS = ['changed-files', 'head-branch', 'base-branch'];
|
||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
@@ -143,10 +145,7 @@ export function getLabelConfigMapFromObject(
|
|||||||
const newConfigs = value.map(toMatchConfig);
|
const newConfigs = value.map(toMatchConfig);
|
||||||
updatedConfig.push({[key]: newConfigs});
|
updatedConfig.push({[key]: newConfigs});
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (ALLOWED_CONFIG_KEYS.includes(key)) {
|
||||||
// These are the keys that we accept and know how to process
|
|
||||||
['changed-files', 'head-branch', 'base-branch'].includes(key)
|
|
||||||
) {
|
|
||||||
const newMatchConfig = toMatchConfig({[key]: value});
|
const newMatchConfig = toMatchConfig({[key]: value});
|
||||||
// Find or set the `any` key so that we can add these properties to that rule,
|
// Find or set the `any` key so that we can add these properties to that rule,
|
||||||
// Or create a new `any` key and add that to our array of configs.
|
// Or create a new `any` key and add that to our array of configs.
|
||||||
|
|||||||
Reference in New Issue
Block a user