Skip to content

Remove audit and fuzz cron jobs #1163

Remove audit and fuzz cron jobs

Remove audit and fuzz cron jobs #1163

Workflow file for this run

name: PR Labeler

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

View workflow run for this annotation

GitHub Actions / PR Labeler

Workflow execution policy warning (evaluate mode)

On December 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, synchronize, reopened]
jobs:
label-pr:
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Label PR based on changed files
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const changedFiles = await github.paginate(
github.rest.pulls.listFiles,
{
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
}
);
// Paths of all the managed labels
const filePathsToLabels = {
'bitcoind/': 'C-bitcoind',
'bitreq/': 'C-bitreq',
'client/': 'C-client',
'electrsd/': 'C-electrsd',
'integration_test/': 'C-integration-test',
'jsonrpc/': 'C-jsonrpc',
'types/': 'C-types',
'verify/': 'C-verify',
};
const labelsToAdd = new Set();
changedFiles.forEach(file => {
const filePath = file.filename;
for (const [path, label] of Object.entries(filePathsToLabels)) {
if (filePath.startsWith(path)) {
labelsToAdd.add(label);
break;
}
}
});
const allKnownLabels = new Set(Object.values(filePathsToLabels));
// Add new managed labels.
if (labelsToAdd.size > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: Array.from(labelsToAdd)
});
}
// Remove any managed labels that no longer apply.
const currentLabels = (await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
})).data.map(label => label.name);
for (const label of currentLabels) {
if (allKnownLabels.has(label) && !labelsToAdd.has(label)) {
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: label,
});
} catch (e) {
// Ignore 404 in case the label was already removed externally.
if (e.status !== 404) throw e;
}
}
}