Skip to content

test(android): send Proxy-Authorization via OkHttp in auth tests #976

test(android): send Proxy-Authorization via OkHttp in auth tests

test(android): send Proxy-Authorization via OkHttp in auth tests #976

Workflow file for this run

name: Label PR

Check warning on line 1 in .github/workflows/label-pr.yml

View workflow run for this annotation

GitHub Actions / Label PR

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
on:
pull_request_target:
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Apply label based on Conventional Commits prefix
uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title;
const prefixMatch = title.match(/^(\w+)(?:\([^)]*\))?(!)?:/);
if (!prefixMatch) return;
const prefix = prefixMatch[1].toLowerCase();
const isBreaking = prefixMatch[2] === '!';
const labelMap = {
feat: '[Type] Enhancement',
fix: '[Type] Bug',
perf: '[Type] Performance',
test: '[Type] Automated Testing',
docs: '[Type] Developer Documentation',
build: '[Type] Build Tooling',
ci: '[Type] Build Tooling',
refactor: '[Type] Task',
task: '[Type] Task',
chore: '[Type] Task',
style: '[Type] Task',
};
const typeLabel = isBreaking ? '[Type] Breaking Change' : labelMap[prefix];
if (!typeLabel) return;
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});
const allTypeLabels = [...Object.values(labelMap), '[Type] Breaking Change'];
const hasConflictingLabel = currentLabels.some(
(l) => allTypeLabels.includes(l.name) && l.name !== typeLabel
);
if (hasConflictingLabel) return;
const alreadyLabeled = currentLabels.some((l) => l.name === typeLabel);
if (alreadyLabeled) return;
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: [typeLabel],
});