ProxmoxVE/.github/workflows/close_template_issue.yml
Workflow config file is invalid. Please check your config file: yaml: line 33: could not find expected ':'
2025-10-11 14:41:27 +02:00

59 lines
2.4 KiB
YAML
Generated
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Auto-Close Wrong Template Issues
on:
issues:
types: [opened]
jobs:
close_tteck_issues:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
steps:
- name: Auto-close if wrong Template issue detected
uses: actions/github-script@v7
with:
script: |
const issue = context.payload.issue;
const content = `${issue.title}\n${issue.body}`;
const issueNumber = issue.number;
// Regex patterns (case-insensitive, flexible versioning)
const patterns = [
/Template\s+debian-13-standard_[\d.]+-[\d]+_amd64\.tar\.zst\s*\[(online|local)\]/i,
/Template\s+debian-13-standard_[\d.]+-[\d]+_amd64\.tar\.zst\s+is\s+missing\s+or\s+corrupted/i,
/Container\s+creation\s+failed\.?\s+Checking\s+if\s+template\s+is\s+corrupted\s+or\s+incomplete/i,
/Template\s+is\s+valid,\s+but\s+container\s+creation\s+still\s+failed/i,
/exit\s+code\s+0:\s+while\s+executing\s+command\s+bash\s+-c\s+"\$?\(curl\s+-fsSL\s+https:\/\/raw\.githubusercontent\.com\/[\w/-]+\/create_lxc\.sh\)"/i
];
const matched = patterns.some((regex) => regex.test(content));
if (matched) {
const message = `👋 Hello!
It looks like you are referencing a **container creation issue with a Debian 13 template** (e.g. \`debian-13-standard_13.x-x_amd64.tar.zst\`).
We receive many similar reports about this, and its not related to the scripts themselves but to **a Proxmox base template bug**.
Please refer to [discussion #8126](https://github.com/community-scripts/ProxmoxVE/discussions/8126) for details.
If your issue persists after following the guidance there, feel free to reopen this issue.
_This issue was automatically closed by a bot._`;
await github.rest.issues.createComment({
...context.repo,
issue_number: issueNumber,
body: message
});
await github.rest.issues.addLabels({
...context.repo,
issue_number: issueNumber,
labels: ["not planned"]
});
await github.rest.issues.update({
...context.repo,
issue_number: issueNumber,
state: "closed"
});
}