Skip to content

feat(api-translator): Implements the v2 <-> v3 backend API translator #1957

feat(api-translator): Implements the v2 <-> v3 backend API translator

feat(api-translator): Implements the v2 <-> v3 backend API translator #1957

Workflow file for this run

name: PR Auto Labeler
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
jobs:
path-labels:
runs-on: self-hosted
steps:
- name: Apply path-based labels
uses: actions/labeler@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
quick-fix-label:
runs-on: self-hosted
steps:
- name: Check total changed lines and add quick fix label
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const prNumber = context.payload.pull_request.number;
// List files in PR
const files = await github.paginate(
github.rest.pulls.listFiles,
{
owner,
repo,
pull_number: prNumber,
per_page: 100,
}
);
// Sum additions + deletions
const changed = files.reduce(
(sum, f) => sum + (f.additions || 0) + (f.deletions || 0),
0
);
core.info(`Total changed lines: ${changed}`);
if (changed <= 20) {
try {
await github.rest.issues.addLabels({
owner,
repo,
issue_number: prNumber,
labels: ["quick fix 🚀"],
});
core.info('Added "quick fix 🚀" label.');
} catch (e) {
core.warning(`Failed to add label: ${e.message}`);
}
} else {
core.info("Change exceeds quick fix threshold; not labeling.");
}