Repository navigation
feat(github.pr.size-labeler): add runtime-installed GitHub Script action - #47
Merged
Merged
Conversation
|
This PR has too many changes. Please make sure you are NOT addressing multiple issues with one PR. |
GitHub Actions Integration
✅ All 1 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
👋 Background
The existing PR size labeler downloads an x86_64-only helper and fails on ARM runners. Replace it with a composite action that preserves tedilabs' size/deletion policies without committing build artifacts.
⚙️ Description
.github/actions/github.pr.size-labelerusingactions/github-script@v9and plain JavaScript. Set up Node 24 and install locked npm dependencies in a fresh runner-temporary directory with lifecycle scripts disabled. The package is namedgithub-pr-size-labeler; no transpilation or bundled dist is needed.github_token, matching other tedilabs composite actions. Preserve every pre-existing input description ingithub.pr.auto-label.yamland keep its thresholds at 15/100/500/1000 with the existing exclusive-boundary behavior..github/size-labeler.yaml, then.github/size-labeler.yml, or readconfig_file. Read from the PR base SHA. YAML groups size settings undersizes.<xs|s|m|l|xl>.label/max_size(XL has no max_size). Partial settings override matching flat action inputs field by field; old flat size keys in config files are rejected. Credentials, API URL, PR number, and config path remain invocation inputs.overwrite_size_labels(default true) for the five configured XS/S/M/L/XL names. When true, replace existing configured labels, including manually applied ones, with the calculated label. When false, preserve all existing labels if any configured size label exists; otherwise add the first size label. Other label names, including other size/* labels, are always preserved. The workflow exposespr_size_overwrite_size_labels.Validation: 107 local tests passed, including 73 policy scenarios and focused configuration/API tests. Nested config tests cover partial overrides, fixed size order, invalid mappings/fields, XL bounds, and rejection of flat file keys. Existing workflow descriptions were compared against main and match exactly. YAML lint, GitHub action/workflow schemas, jactionlint, and diff checks passed. Dedicated Linux AMD64 and ARM64 CI tests the actual composite with runtime npm installation and read-only GitHub API calls.
🚨 To Reviewers
added_labelsandremoved_labelsare empty when no label change is planned.