Skip to content

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

Merged
MaksimZhukov merged 2 commits into
actions:v5.0.0-betafrom
MaksimZhukov:implement-new-match-object-structure
Sep 20, 2023
Merged

MaksimZhukov merged 2 commits into
actions:v5.0.0-betafrom
MaksimZhukov:implement-new-match-object-structure

Conversation

@MaksimZhukov

Copy link
Copy Markdown
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
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