Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/update_draft_features_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: git rm features/draft/spec/*.yml features/draft/spec/*.dist
- run: npm run update-drafts
- run: npm run dist
- name: Create pull request
Expand Down
22 changes: 17 additions & 5 deletions scripts/update-drafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,27 @@ async function main() {
}
}

// If all features are already part of web-features, skip this spec.
const id = formatIdentifier(spec.shortname);
const destination = `features/draft/spec/${id}.yml`;

// If all features are already part of web-features
if (compatFeatures.size === 0) {
const dist = `${destination}.dist`;
try {
await fs.rm(destination);
logger.warn(`${destination}: deleted`);
} catch (error) {
logger.debug(`${destination}: deletion failed`);
}
try {
await fs.rm(dist);
logger.warn(`${dist}: deleted`);
} catch (error) {
logger.debug(`${dist}: deletion failed`);
}
continue;
}

// Write out draft feature per spec.
const id = formatIdentifier(spec.shortname);

const feature = new Document({
draft_date: new Date().toISOString().substring(0, 10),
name: spec.title,
Expand All @@ -197,7 +210,6 @@ async function main() {
feature.comment = usedFeaturesComment.trimEnd();
}

const destination = `features/draft/spec/${id}.yml`;
const proposedFile = feature.toString();

let originalFile: string;
Expand Down