mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 10:19:16 +00:00
Website: Fix Zitadel Logo & Created-Date (#2217)
* Website: Fix Zitadel Logo & Created-Date * Update autolabeler.yml * Update autolabeler.yml
This commit is contained in:
parent
e4ee00b403
commit
4c7d82f4eb
55
.github/workflows/autolabeler.yml
vendored
55
.github/workflows/autolabeler.yml
vendored
@ -16,60 +16,47 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install minimatch
|
||||||
|
run: npm install minimatch
|
||||||
|
|
||||||
- name: Label PR based on config rules
|
- name: Label PR based on config rules
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const { minimatch } = require('minimatch');
|
||||||
// `require.resolve()` sorgt dafür, dass `minimatch` aus der GitHub-Umgebung geladen wird.
|
|
||||||
const minimatch = require(require.resolve("minimatch"));
|
|
||||||
|
|
||||||
const configPath = path.resolve(process.env.CONFIG_PATH);
|
const configPath = path.resolve(process.env.CONFIG_PATH);
|
||||||
let config;
|
|
||||||
try {
|
|
||||||
const fileContent = await fs.readFile(configPath, 'utf-8');
|
const fileContent = await fs.readFile(configPath, 'utf-8');
|
||||||
config = JSON.parse(fileContent);
|
const autolabelerConfig = JSON.parse(fileContent);
|
||||||
} catch (error) {
|
|
||||||
console.error(`❌ Fehler beim Laden der Konfigurationsdatei: ${error.message}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const prNumber = context.payload.pull_request.number;
|
const prNumber = context.payload.pull_request.number;
|
||||||
const prFiles = (await github.rest.pulls.listFiles({
|
const prListFilesResponse = await github.rest.pulls.listFiles({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
pull_number: prNumber,
|
pull_number: prNumber,
|
||||||
})).data;
|
});
|
||||||
|
const prFiles = prListFilesResponse.data;
|
||||||
|
|
||||||
let labelsToAdd = new Set();
|
for (const [label, rules] of Object.entries(autolabelerConfig)) {
|
||||||
|
const shouldAddLabel = prFiles.some((prFile) => {
|
||||||
|
return rules.some((rule) => {
|
||||||
|
const isFileStatusMatch = rule.fileStatus ? rule.fileStatus === prFile.status : true;
|
||||||
|
const isIncludeGlobMatch = rule.includeGlobs.some((glob) => minimatch(prFile.filename, glob));
|
||||||
|
const isExcludeGlobMatch = rule.excludeGlobs.some((glob) => minimatch(prFile.filename, glob));
|
||||||
|
|
||||||
for (const [label, rules] of Object.entries(config)) {
|
return isFileStatusMatch && isIncludeGlobMatch && !isExcludeGlobMatch;
|
||||||
if (prFiles.some(prFile =>
|
});
|
||||||
rules.some(rule =>
|
});
|
||||||
(!rule.fileStatus || rule.fileStatus === prFile.status) &&
|
|
||||||
rule.includeGlobs.some(glob => minimatch(prFile.filename, glob)) &&
|
|
||||||
!rule.excludeGlobs.some(glob => minimatch(prFile.filename, glob))
|
|
||||||
)
|
|
||||||
)) {
|
|
||||||
labelsToAdd.add(label);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const existingLabels = new Set((await github.rest.issues.listLabelsOnIssue({
|
if (shouldAddLabel) {
|
||||||
owner: context.repo.owner,
|
console.log(`Adding label ${label} to PR ${prNumber}`);
|
||||||
repo: context.repo.repo,
|
|
||||||
issue_number: prNumber,
|
|
||||||
})).data.map(l => l.name));
|
|
||||||
|
|
||||||
labelsToAdd = [...labelsToAdd].filter(label => !existingLabels.has(label));
|
|
||||||
|
|
||||||
if (labelsToAdd.length > 0) {
|
|
||||||
await github.rest.issues.addLabels({
|
await github.rest.issues.addLabels({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: prNumber,
|
issue_number: prNumber,
|
||||||
labels: labelsToAdd,
|
labels: [label],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
"categories": [
|
"categories": [
|
||||||
6
|
6
|
||||||
],
|
],
|
||||||
"date_created": "2025-02-07",
|
"date_created": "2025-02-10",
|
||||||
"type": "ct",
|
"type": "ct",
|
||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 8080,
|
"interface_port": 8080,
|
||||||
"documentation": "https://zitadel.com/docs/guides/overview",
|
"documentation": "https://zitadel.com/docs/guides/overview",
|
||||||
"website": "https://zitadel.com",
|
"website": "https://zitadel.com",
|
||||||
"logo": "https://zitadel.com/zitadel-logo-dark.svg",
|
"logo": "https://raw.githubusercontent.com/zitadel/zitadel/refs/heads/main/console/src/assets/icons/android-chrome-512x512.png",
|
||||||
"description": "Zitadel is an open-source identity and access management (IAM) solution designed to provide secure authentication, authorization, and user management for modern applications and services. Built with a focus on flexibility, scalability, and security, Zitadel offers a comprehensive set of features for developers and organizations looking to implement robust identity management.",
|
"description": "Zitadel is an open-source identity and access management (IAM) solution designed to provide secure authentication, authorization, and user management for modern applications and services. Built with a focus on flexibility, scalability, and security, Zitadel offers a comprehensive set of features for developers and organizations looking to implement robust identity management.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user