Skip to content

Releases: actions/labeler

v5.0.0

04 Dec 14:14
8558fd7
Compare
Choose a tag to compare

What's Changed

This release contains the following breaking changes:

  1. The ability to apply labels based on the names of base and/or head branches was added (#186 and #54). The match object for changed files was expanded with new combinations in order to make it more intuitive and flexible (#423 and #101). As a result, the configuration file structure was significantly redesigned and is not compatible with the structure of the previous version. Please read the action documentation to find out how to adapt your configuration files for use with the new action version.

  2. The bug related to the sync-labels input was fixed (#112). Now the input value is read correctly.

  3. By default, dot input is set to true. Now, paths starting with a dot (e.g. .github) are matched by default.

  4. Version 5 of this action updated the runtime to Node.js 20. All scripts are now run with Node.js 20 instead of Node.js 16 and are affected by any breaking changes between Node.js 16 and 20.

For more information, please read the action documentation.

New Contributors

Full Changelog: v4...v5.0.0

v5.0.0-beta.1

20 Sep 11:55
f4eefdc
Compare
Choose a tag to compare
Pre-release

What's Changed

In scope of this beta release, 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']

This is a beta version and we would appreciate it if you could provide us with your feedback. If you have any questions, ideas or concerns, please share them in the corresponding issue.

Details

In the implementation of the alpha 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

How do the any and all top-level keys work?

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

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

If an option is specified without a top-level key, it will default to any.

Usage example:

# Add the `frontend` label to any change to any *.js files as long as the `main.js` hasn't been changed and the PR is open against the `main` branch
frontend:
- all:
  - changed-files: 
    - AnyGlobToAnyFile: ['src/**/*.js']
    - AllGlobsToAllFiles: ['!src/main.js']
  - base-branch: 'main'

Full Changelog: v5.0.0-alpha.1...v5.0.0-beta.1

v4.3.0

10 Jul 11:53
ac9175f
Compare
Choose a tag to compare

What's Changed

In scope of this release, the ability to specify pull request number(s) was added by @credfeto in #349.

Support for reading from the configuration file presented on the runner was added by @lrstanley in #394. It allows you to use a configuration file generated during workflow run or uploaded from a separate repository.

Please refer to the action documentation for more information.

This release also includes the following changes:

New Contributors

Full Changelog: v4...v4.3.0

v4.2.0

29 Jun 12:09
0967ca8
Compare
Choose a tag to compare

What's Changed

In the scope of this release, the following outputs were added by @danielsht86 in #60:

  • new-labels - a comma-separated string that contains all newly added labels.
  • all-labels - a comma-separated string that contains all labels currently assigned to the PR.

For detailed information, please refer to our updated documentation.

The issue of encountering an HttpError: Server Error when adding more than 50 labels has been successfully resolved by @markmssd in #497. However, it's important to note that the GitHub API imposes a limit of 100 labels. To ensure smooth operation, a warning message that will alert you if the number of labels exceeds this limit was implemented. From this point forward, if more than 100 labels are specified, only the first 100 will be assigned.

The error handling for the Resource not accessible by integration error was added by @jsoref in #405. Now, if the workflow is misconfigured, the labeler provides a clear warning and guidance for correction.

This release also includes the following changes:

New Contributors

Full Changelog: v4...v4.2.0

v4.1.0

05 Jun 10:30
9fcb2c2
Compare
Choose a tag to compare

What's Changed

In scope of this release, the dot input was added by @kachkaev in #316. It allows patterns to match paths starting with a period. This input is set to false by default.

Usage

name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
  triage:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
    - uses: actions/labeler@v4
      with:
        dot: true

This release also includes the following changes:

New Contributors

Full Changelog: v4...v4.1.0

v5.0.0-alpha.1

24 May 11:53
4f05277
Compare
Choose a tag to compare
Pre-release

What's Changed

This alpha release introduces the following major changes:

  1. Fix the bug related to the sync-labels input. Now the input value is read correctly. #480
  2. Add the ability to apply labels based on base and/or head branch names. #203
  3. Change the behavior of the any selector to match ANY file against ANY glob pattern.

This is an alpha version and we would appreciate it if you could provide us with your feedback. If you have any questions, ideas or concerns, please share them in the corresponding issue.

Usage

The match object allows you to control the matching options. You can specify the label to be applied based on the changed files and/or the name of the base or head branch. For the changed files, you have to provide a path glob, and for the branches, you have to provide a regexp to match against the branch name.

Please note that the structure of the configuration file (.github/labeler.yml) has been changed! There are two top-level keys: any and all, that accept the same configuration options:

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']

How do the any and all keys work?

  1. all: all of the provided options (changed-files, base-branch, etc.) must match for the label to be applied. ALL globs or regexps must match against branch names or ALL changed files.
  2. any: any of the provided options (changed-files, base-branch, etc.) must match for the label to be applied. ANY globs or regexps must match against branch names or ANY changed files.

Note: The behavior of the any selector for changed files has been changed to match ANY file against ANY glob pattern.

# Add the `frontend` label to any change to any *.js files as long as the `main.js` hasn't been changed and the PR is open against the `main` branch
frontend:
- any:
  - changed-files: ['src/**/*.js']
- all:
  - changed-files: ['!src/main.js']
  - base-branch: 'main'

If an option is specified without a top-level key, it will default to any. In particular, the following two configurations are equivalent:

LabelName:
- changed-files: src/*

and

LabelName:
- any:
  - changed-files: ['src/*']

More examples

  1. Add the feature label to any PR where the head branch name starts with feature or has feature in the name
feature:
- head-branch: ['^feature', 'feature']
  1. Add the release label to any PR that is open against the main branch
release:
- base-branch: 'main'
  1. Add the test label to any PR that is open against the main branch and the head branch name starts with feature
test:
- all:
  - base-branch: 'main'
  - head-branch: '^feature'
  1. Add the test label if there are any changes in the *.js files within the source directory or within the __tests__ directory, or the head branch name starts with example
test:
- any:
  - changed-files: ['__tests__/**/*.js', 'src/**/*.js']
  - head-branch: '^example'

New Contributors

v4.0.4

24 May 11:44
0776a67
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4...v4.0.4

v4.0.3

07 Mar 11:33
ba790c8
Compare
Choose a tag to compare

What's Changed

  • Make the repo-token input optional. Default is github.token (#227)
  • Bump typescript to 4.9.5 (#496)
  • Bump prettier to 2.8.4 (#498)
  • Bump @vercel/ncc to 0.36.1 (#493)
  • Bump @actions/github, minimatch and @types/minimatch (#477)
  • Update documentation (#278, #285, #476 and #495)

v4.0.2

07 Oct 10:07
5c75392
Compare
Choose a tag to compare
Merge pull request #444 from actions/rentziass/update-actions-core

Update @actions/core to 1.10.0

v4.0.1

12 Aug 16:35
@pje pje
e54e5b3
Compare
Choose a tag to compare
  • Update @actions/core dependency to v1.9.1 to pull in recent security fixes