|
24 | 24 | (new SingleCommandApplication()) |
25 | 25 | ->setName('changelog-pr') |
26 | 26 | ->setDescription('Create CHANGELOG.md update PRs') |
27 | | - ->addOption('milestone', 'm', InputOption::VALUE_REQUIRED, 'Milestone name') |
| 27 | + ->addOption('version', null, InputOption::VALUE_REQUIRED, 'Version string (e.g., 8.0.0.3)') |
28 | 28 | ->addOption('branches', null, InputOption::VALUE_REQUIRED, 'Comma-separated target branches') |
29 | 29 | ->addOption('openemr-dir', null, InputOption::VALUE_REQUIRED, 'Path to openemr checkout') |
30 | 30 | ->addOption('changelog-file', null, InputOption::VALUE_REQUIRED, 'Path to changelog entry file') |
31 | 31 | ->addOption('repo', 'r', InputOption::VALUE_REQUIRED, 'GitHub repo', 'openemr/openemr') |
32 | 32 | ->setCode(function (InputInterface $input, OutputInterface $output): int { |
33 | | - /** @var string $milestone */ |
34 | | - $milestone = $input->getOption('milestone'); |
| 33 | + /** @var string $version */ |
| 34 | + $version = $input->getOption('version'); |
35 | 35 | /** @var string $openemrDir */ |
36 | 36 | $openemrDir = $input->getOption('openemr-dir'); |
37 | 37 | /** @var string $changelogFile */ |
|
41 | 41 | /** @var string $branchesRaw */ |
42 | 42 | $branchesRaw = $input->getOption('branches'); |
43 | 43 |
|
44 | | - foreach (['milestone', 'branches', 'openemr-dir', 'changelog-file'] as $required) { |
| 44 | + foreach (['version', 'branches', 'openemr-dir', 'changelog-file'] as $required) { |
45 | 45 | if ($input->getOption($required) === null) { |
46 | 46 | $output->writeln("<error>--{$required} is required</error>"); |
47 | 47 | return 1; |
|
63 | 63 |
|
64 | 64 | foreach ($branches as $branch) { |
65 | 65 | $branch = trim($branch); |
66 | | - $prBranch = "changelog-{$milestone}-{$branch}"; |
| 66 | + $prBranch = "changelog-{$version}-{$branch}"; |
67 | 67 |
|
68 | 68 | // Check if PR already exists |
69 | 69 | $check = new Process( |
|
97 | 97 | // Commit, push, create PR |
98 | 98 | (new Process(['git', 'add', 'CHANGELOG.md'], $openemrDir))->mustRun(); |
99 | 99 | (new Process( |
100 | | - ['git', 'commit', '-m', "docs: add {$milestone} changelog"], |
| 100 | + ['git', 'commit', '-m', "docs: add {$version} changelog"], |
101 | 101 | $openemrDir, |
102 | 102 | ))->mustRun(); |
103 | 103 | (new Process(['git', 'push', 'origin', $prBranch], $openemrDir))->mustRun(); |
|
106 | 106 | '--repo', $repo, |
107 | 107 | '--base', $branch, |
108 | 108 | '--head', $prBranch, |
109 | | - '--title', "docs: add {$milestone} changelog", |
110 | | - '--body', "Add changelog entry for {$milestone} release.", |
| 109 | + '--title', "docs: add {$version} changelog", |
| 110 | + '--body', "Add changelog entry for {$version} release.", |
111 | 111 | ]))->mustRun(); |
112 | 112 |
|
113 | 113 | $output->writeln("Created PR for <info>{$prBranch}</info> → {$branch}"); |
|
0 commit comments