Releases: actions/labeler
v5.0.0
What's Changed
This release contains the following breaking changes:
-
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.
-
The bug related to the
sync-labels
input was fixed (#112). Now the input value is read correctly. -
By default,
dot
input is set totrue
. Now, paths starting with a dot (e.g..github
) are matched by default. -
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
- @joshdales made their first contribution in #203
- @dusan-trickovic made their first contribution in #626
- @sungh0lim made their first contribution in #630
- @TrianguloY made their first contribution in #629
Full Changelog: v4...v5.0.0
v5.0.0-beta.1
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:
any
(ANY glob must match against ANY changed file) andall
(ALL globs must match against ALL changed files).
In scope of this PR, we expanded this functionality and provided the following combinations:
AnyGlobToAnyFile
- ANY glob must match against ANY changed fileAllGlobsToAnyFile
- ALL globs must match against ANY changed fileAnyGlobToAllFiles
- ANY glob must match against ALL changed filesAllGlobsToAllFiles
- 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:
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.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
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:
- Improved Error message for missing config file by @Gornoka in #475
- Early exit when no files are changed by @nathanhammond in #456
- Add examples to match all repo files by @MaksimZhukov in #600
- Fix a typo in the example about using the action outputs by @MaksimZhukov in #606
- Bump eslint from 8.43.0 to 8.44.0 by @dependabot in #601
- Bump @typescript-eslint/parser from 5.60.1 to 5.61.0 by @dependabot in #602
- Bump @typescript-eslint/eslint-plugin from 5.60.1 to 5.61.0 by @dependabot in #604
- Bump tough-cookie from 4.1.2 to 4.1.3 by @dependabot in #609
- Bump @octokit/plugin-retry from 5.0.4 to 5.0.5 by @MaksimZhukov in #610
New Contributors
- @credfeto made their first contribution in #349
- @lrstanley made their first contribution in #394
- @nathanhammond made their first contribution in #456
Full Changelog: v4...v4.3.0
v4.2.0
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:
- Warn about the limitations of GitHub tokens by @dfandrich in #491
- Improve readme by @jsoref in #589
- Bump eslint-plugin-jest from 27.2.1 to 27.2.2 by @dependabot in #591
- Bump eslint from 8.42.0 to 8.43.0 by @dependabot in #592
- Bump @typescript-eslint/eslint-plugin from 5.60.0 to 5.60.1 by @dependabot in #598
- Bump @typescript-eslint/parser from 5.60.0 to 5.60.1 by @dependabot in #597
- Bump @octokit/plugin-retry from 5.0.2 to 5.0.4 by @MaksimZhukov in #599
New Contributors
- @dfandrich made their first contribution in #491
- @markmssd made their first contribution in #497
- @danielsht86 made their first contribution in #60
Full Changelog: v4...v4.2.0
v4.1.0
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:
- Simplify globbing examples in README by @Youssef1313 in #451
- Bump @typescript-eslint/parser from 5.59.7 to 5.59.8 by @dependabot in #577
- Bump @typescript-eslint/eslint-plugin from 5.59.7 to 5.59.8 by @dependabot in #578
New Contributors
- @Youssef1313 made their first contribution in #451
- @kachkaev made their first contribution in #316
Full Changelog: v4...v4.1.0
v5.0.0-alpha.1
What's Changed
This alpha release introduces the following major changes:
- Fix the bug related to the
sync-labels
input. Now the input value is read correctly. #480 - Add the ability to apply labels based on base and/or head branch names. #203
- 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?
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.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
- Add the
feature
label to any PR where the head branch name starts withfeature
or hasfeature
in the name
feature:
- head-branch: ['^feature', 'feature']
- Add the
release
label to any PR that is open against themain
branch
release:
- base-branch: 'main'
- Add the
test
label to any PR that is open against themain
branch and the head branch name starts withfeature
test:
- all:
- base-branch: 'main'
- head-branch: '^feature'
- 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 withexample
test:
- any:
- changed-files: ['__tests__/**/*.js', 'src/**/*.js']
- head-branch: '^example'
New Contributors
- @adam-azarchs made their first contribution in #480
- @joshdales made their first contribution in #203
v4.0.4
What's Changed
- Add and configure ESLint and update configuration for Prettier by @IvanZosimov in #508
- Turn on automatic update of ESLint and Prettier configuration files by @IvanZosimov in #509
- Automatic update of configuration files from 03/12/2023 by @github-actions in #513
- Bump eslint-config-prettier from 8.6.0 to 8.8.0 by @dependabot in #520
- Rebuild minimatch by @panticmilos in #522
- Bump license version by @panticmilos in #525
- Fix glob bug in package.json scripts section by @IvanZosimov in #528
- Bump prettier from 2.8.7 to 2.8.8 by @dependabot in #544
- Bump eslint from 8.40.0 to 8.41.0 by @dependabot in #569
- Bump @typescript-eslint/parser from 5.59.6 to 5.59.7 by @dependabot in #573
- Bump @typescript-eslint/eslint-plugin from 5.59.6 to 5.59.7 by @dependabot in #572
- Remove implicit dependencies by @nikolai-laevskii in #571
- Automatic update of configuration files from 05/23/2023 by @github-actions in #570
New Contributors
- @github-actions made their first contribution in #513
- @panticmilos made their first contribution in #522
- @nikolai-laevskii made their first contribution in #571
Full Changelog: v4...v4.0.4
v4.0.3
v4.0.2
Merge pull request #444 from actions/rentziass/update-actions-core Update @actions/core to 1.10.0
v4.0.1
- Update
@actions/core
dependency tov1.9.1
to pull in recent security fixes