Automattic / Automattic/jetpack

Repo Gardening: extract label detection to a config file

Open
#19,897 2 comments 0 reactions 1 assignee Claimed by @jeherve View on GitHub
[Action] Repo Gardening [Pri] Normal Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

The Repo Gardening action's `addLabels` task currently relies on detecting paths that are hardcoded in the action:
https://github.com/Automattic/jetpack/blob/a5f167cbc51792848f4fa53e57801bd709527bfa/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js#L81-L91

While this works, it also means that the task cannot be used by third-parties unless their file structure matches ours. That is not ideal.

Let's aim to have those paths defined in a config file, maybe a `.json` file that would live in the `.github` directory of any repo using the action and that task, and where we would define a list of label names and matching patterns that could be used by the action.

Noting that this config file would have to support more complex patterns, such as the ones we use here:
https://github.com/Automattic/jetpack/blob/a5f167cbc51792848f4fa53e57801bd709527bfa/projects/github-actions/repo-gardening/src/tasks/add-labels/index.js#L104-L123

************

Related PR: #19891

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.