Commit a7a68c1
committed
release-scripts: refuse downgrades and short-circuit no-op runs
Both .github/release-homebrew.sh and .github/release-vfsforgit.sh are
meant to be run by hand by whoever promotes a microsoft/git
pre-release to a full release. That human is likely tired at the end
of a long release day, may paste the wrong tag, or may re-trigger the
promotion out of habit. Without a guard, either mistake silently
rewrites the downstream state and, in the VFSForGit case, opens a
bogus pull request on top.
Teach both scripts to look at the downstream's current state before
touching anything: the `version '...'` line in the microsoft-git
cask, and the `GIT_VERSION` default in VFSForGit's build workflow.
If the downstream is already at the target version, warn and exit
successfully so a duplicate run is a quiet no-op rather than
pointless churn. If the target is older than what the downstream
already has, refuse with an explicit "regression: refusing to
downgrade" error rather than clobbering it.
Version comparison uses `sort -V`, which orders our
`vX.Y.Z.vfs.N.M` tag shape correctly.
The check runs before any clone or push, and the only API call it
adds (`gh api ... contents/<file>` with the raw accept header) is
read-only, so a bug in the guard itself cannot damage the downstream.
The third release script, .github/release-winget.ps1, is
intentionally left untouched here; a follow-up commit ports it from
PowerShell to POSIX sh and adds the same guard along the way.
Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 9ca55d4 commit a7a68c1
3 files changed
Lines changed: 69 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
42 | 63 | | |
43 | 64 | | |
44 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
| |||
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 133 | | |
114 | 134 | | |
115 | 135 | | |
| |||
0 commit comments