Skip to content

Verify downloaded installers against their published hash and report the signer #53

Verify downloaded installers against their published hash and report the signer

Verify downloaded installers against their published hash and report the signer #53

Workflow file for this run

name: Pull Request Labeler

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

View workflow run for this annotation

GitHub Actions / Pull Request 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, reopened, edited, synchronize, ready_for_review]
concurrency:
group: pr-labeler-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
issues: read
jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Label by changed files
uses: actions/labeler@v7
- name: Copy the type label from linked issues
uses: actions/github-script@v9
with:
script: |
const typeLabels = ['bug', 'new-feature', 'enhancement'];
const { owner, repo } = context.repo;
const number = context.payload.pull_request.number;
const result = await github.graphql(`
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
labels(first: 100) { nodes { name } }
closingIssuesReferences(first: 20) {
nodes { labels(first: 50) { nodes { name } } }
}
}
}
}`, { owner, repo, number });
const pr = result.repository.pullRequest;
if (pr.labels.nodes.some(l => typeLabels.includes(l.name))) {
core.info('The pull request already has a type label.');
return;
}
const found = new Set(
pr.closingIssuesReferences.nodes
.flatMap(issue => issue.labels.nodes.map(l => l.name))
.filter(name => typeLabels.includes(name)));
if (found.size !== 1) {
core.info(`Linked issues carry ${found.size} distinct type labels; adding none.`);
return;
}
const [label] = found;
await github.rest.issues.addLabels({ owner, repo, issue_number: number, labels: [label] });
core.info(`Added '${label}' from the linked issues.`);