Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Beta] Implement the new structure of the match object for the changed-files section #680

Merged
merged 2 commits into from
Sep 20, 2023
Merged

[Beta] Implement the new structure of the match object for the changed-files section #680

merged 2 commits into from
Sep 20, 2023

Conversation

MaksimZhukov
Copy link
Contributor

Description:
In scope of this pull request, the structure of the configuration file (.github/labeler.yml) was changed from

LabelName:
- any:
  - changed-files: ['list', 'of', 'globs']
  - base-branch: ['list', 'of', 'regexps']
  - head-branch: ['list', 'of', 'regexps']
- all:
  - changed-files: ['list', 'of', 'globs']
  - base-branch: ['list', 'of', 'regexps']
  - head-branch: ['list', 'of', 'regexps']

to

LabelName:
- any:
  - changed-files: 
    - AnyGlobToAnyFile: ['list', 'of', 'globs']
    - AnyGlobToAllFiles: ['list', 'of', 'globs']
    - AllGlobsToAnyFile: ['list', 'of', 'globs']
    - AllGlobsToAllFiles: ['list', 'of', 'globs']
  - base-branch: ['list', 'of', 'regexps']
  - head-branch: ['list', 'of', 'regexps']
- all:
  - changed-files:
    - AnyGlobToAnyFile: ['list', 'of', 'globs']
    - AnyGlobToAllFiles: ['list', 'of', 'globs']
    - AllGlobsToAnyFile: ['list', 'of', 'globs']
    - AllGlobsToAllFiles: ['list', 'of', 'globs']
  - base-branch: ['list', 'of', 'regexps']
  - head-branch: ['list', 'of', 'regexps']

In the previous implementation of the beta version there were two options for changed-files:

  1. any (ANY glob must match against ANY changed file) and
  2. all (ALL globs must match against ALL changed files).

In scope of this PR, we expanded this functionality and provided the following combinations:

  1. AnyGlobToAnyFile - ANY glob must match against ANY changed file
  2. AllGlobsToAnyFile - ALL globs must match against ANY changed file
  3. AnyGlobToAllFiles - ANY glob must match against ALL changed files
  4. AllGlobsToAllFiles - ALL globs must match against ALL changed files

Top-level keys (any and all) do not affect the behaviour of changed-files and bind options (changed-files, base-branch, head-branch) in the following ways:

  1. all: all of the provided options (changed-files, base-branch, etc.) must match for the label to be applied.
  2. any: any of the provided options (changed-files, base-branch, etc.) must match for the label to be applied.

Related issue:
#423

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@MaksimZhukov MaksimZhukov requested a review from a team as a code owner September 20, 2023 11:26
@MaksimZhukov MaksimZhukov merged commit f4eefdc into actions:v5.0.0-beta Sep 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants