Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
changed-files-labels-limit: 3
Comment thread
GabrielDuf marked this conversation as resolved.
Resolved

winget:
- changed-files:
- any-glob-to-any-file:
- src/UniGetUI.PackageEngine.Managers.WinGet/**
- src/WindowsPackageManager.Interop/**

scoop:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Scoop/**

chocolatey:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Chocolatey/**

pip:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Pip/**

npm:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Npm/**

powershell:
- changed-files:
- any-glob-to-any-file:
- src/UniGetUI.PackageEngine.Managers.PowerShell/**
- src/UniGetUI.PackageEngine.Managers.PowerShell7/**

cargo:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Cargo/**

dotnet-tool:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Dotnet/**

vcpkg:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.PackageEngine.Managers.Vcpkg/**

translations:
- changed-files:
- all-globs-to-any-file:
- src/Languages/lang_*.json
- "!src/Languages/lang_en.json"

appearance:
- changed-files:
- any-glob-to-any-file: src/UniGetUI.Avalonia/Assets/Styles/**
24 changes: 24 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
changelog:
exclude:
labels:
- dependencies
- github_actions
authors:
- dependabot
- dependabot[bot]
categories:
- title: New features
labels:
- new-feature
- title: Improvements
labels:
- enhancement
- title: Bug fixes
labels:
- bug
- title: Translations
labels:
- translations
- title: Other changes
labels:
- "*"
62 changes: 62 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Pull Request Labeler

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.`);
Loading