Skip to content

Commit 7c193ac

Browse files
authored
Add release alias map to releases.json (#23626)
1 parent fdfcfd9 commit 7c193ac

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

.github/aw/releases.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"$schema": "./releases.schema.json",
33
"blockedVersions": [],
44
"minimumVersion": "v0.64.4",
5-
"minRecommendedVersion": "v0.64.4"
5+
"minRecommendedVersion": "v0.64.4",
6+
"aliases": {
7+
"latest": "latest",
8+
"stable": "v0.64.5"
9+
}
610
}

.github/aw/releases.schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
"description": "The minimum recommended compile-agentic version in vMAJOR.MINOR.PATCH format. Workflows compiled with a version below this will emit a warning (but not fail) at activation, nudging users to upgrade. Use an empty string to disable this check.",
3232
"pattern": "^(v[0-9]+\\.[0-9]+\\.[0-9]+)?$",
3333
"default": ""
34+
},
35+
"aliases": {
36+
"type": "object",
37+
"description": "A map of release alias names to version strings. The special value 'latest' resolves to the most recent release. Other values must be a version string in vMAJOR.MINOR.PATCH format.",
38+
"additionalProperties": {
39+
"type": "string",
40+
"pattern": "^(latest|v[0-9]+\\.[0-9]+\\.[0-9]+)$",
41+
"description": "A version string in vMAJOR.MINOR.PATCH format or the special value 'latest'"
42+
},
43+
"default": {}
3444
}
3545
}
3646
}

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,13 +869,30 @@ jobs:
869869
const errors = [];
870870
871871
// Check additionalProperties (only allow known keys)
872-
const allowedKeys = new Set(['$schema', 'blockedVersions', 'minimumVersion', 'minRecommendedVersion']);
872+
const allowedKeys = new Set(['$schema', 'blockedVersions', 'minimumVersion', 'minRecommendedVersion', 'aliases']);
873873
for (const key of Object.keys(config)) {
874874
if (!allowedKeys.has(key)) {
875875
errors.push(`Unknown property: '${key}'`);
876876
}
877877
}
878878
879+
// Validate aliases
880+
if ('aliases' in config) {
881+
const aliases = config.aliases;
882+
if (typeof aliases !== 'object' || aliases === null || Array.isArray(aliases)) {
883+
errors.push("'aliases' must be an object");
884+
} else {
885+
const aliasValuePattern = /^(latest|v[0-9]+\.[0-9]+\.[0-9]+)$/;
886+
for (const [alias, value] of Object.entries(aliases)) {
887+
if (typeof value !== 'string') {
888+
errors.push(`'aliases.${alias}' must be a string`);
889+
} else if (!aliasValuePattern.test(value)) {
890+
errors.push(`'aliases.${alias}' ('${value}') must be 'latest' or a version in vMAJOR.MINOR.PATCH format (e.g. 'v1.2.3')`);
891+
}
892+
}
893+
}
894+
}
895+
879896
// Validate blockedVersions
880897
if ('blockedVersions' in config) {
881898
const bv = config.blockedVersions;

0 commit comments

Comments
 (0)