Files
ProxmoxVE/.github/workflows/php-drift-pr-closed.yml
CanbiZ (MickLesk) 88393c58b5 Add a weekly PHP version drift check (#19094)
Compares each script's pinned PHP with the release it installs:
require.php, the lowest PHP its locked packages need (and their upper
bounds where the script runs composer install), the Dockerfile and
config.platform.php. One PR per script rewrites PHP_VERSION, php8.x
package and service names and /etc/php paths, and says when existing
containers keep the old FPM socket.
2026-11-27 11:25:02 +01:00

55 lines
2.1 KiB
YAML
Generated

name: Record closed PHP drift PR
# The drift check opens one PR per script and treats a closed one as a verdict:
# that bump is not proposed again. Record it on the report so the decision is
# visible there.
on:
pull_request:
types: [closed]
jobs:
record:
if: >
github.repository == 'community-scripts/ProxmoxVE' &&
github.event.pull_request.merged == false &&
startsWith(github.event.pull_request.head.ref, 'php-drift/')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v9
with:
script: |
const pr = context.payload.pull_request;
const owner = context.repo.owner;
const repo = context.repo.repo;
// php-drift/<slug>-<from>-to-<to>
const m = pr.head.ref.match(/^php-drift\/(.+)-(\d+\.\d+)-to-(\d+\.\d+)$/);
if (!m) return;
const [, slug, from, to] = m;
// A close by the stale bot is a lapsed review, not a decision on
// the bump, and the drift check reopens those.
const stale = pr.labels.some((l) => l.name === 'stale');
const issues = await github.rest.issues.listForRepo({
owner, repo, state: 'open', labels: 'automated,dependencies', per_page: 100,
});
const issue = issues.data.find(
(i) => !i.pull_request && i.title === '[Automated] PHP Version Drift Report',
);
if (!issue) return;
const body = stale
? `\`${slug}\` — PR #${pr.number} (PHP ${from} → ${to}) was closed as stale. `
+ `No decision was recorded, so the next drift check opens it again.`
: `\`${slug}\` — PR #${pr.number} (PHP ${from} → ${to}) was closed without merging. `
+ `The script keeps PHP ${from} and this bump will not be proposed again. `
+ `If it was closed by mistake, reopen the PR.`;
await github.rest.issues.createComment({
owner, repo, issue_number: issue.number, body,
});