From 312adc71132fe958537429fc183bb5ea379226e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Daoust?= Date: Mon, 13 Mar 2023 07:12:59 +0100 Subject: [PATCH] Rename "prepare" script to "curate" to prevent auto-runs (#914) The `prepare` script runs automatically when the repository is installed. On top of creating issues when the repository is set as dependency in another project for some reason, as described in: https://github.com/w3c/webref/issues/789#issuecomment-1464094879 ... this also seems wrong because: 1. There is no guarantee that the curation will run without errors. A patch may no longer apply for instance. 2. Projects may want to depend on the raw data and may not need to run the curation and package preparation logic at all. This update replaces the "prepare" script with a "curate" one, explicitly called in the jobs that need it. Other projects that depend on the webref repository directly and on curated data also need to update to call npm run curate explicitly. --- .github/workflows/curate.yml | 6 ++++-- .github/workflows/test.yml | 8 ++++++-- package.json | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/curate.yml b/.github/workflows/curate.yml index 953e4f139dc1..9acb7fa3e222 100644 --- a/.github/workflows/curate.yml +++ b/.github/workflows/curate.yml @@ -34,10 +34,12 @@ jobs: # the curated branch fetch-depth: 0 - - name: Prepare curated and packages data - # Note that "ci" runs the "prepare" script + - name: Install dependencies run: npm ci + - name: Prepare curated and packages data + run: npm run curate + - name: Test curated and packages data run: npm run test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d8e23a3f1fb..1ed0a616ed7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,11 @@ jobs: - uses: actions/setup-node@v2 with: node-version: '14' - - run: npm ci - - run: npm test + - name: Install dependencies + run: npm ci + - name: Prepare curated and packages data + run: npm run curate + - name: Test curated and packages data + run: npm test env: FORCE_COLOR: 3 diff --git a/package.json b/package.json index 20a8b0fed0ef..cd7cd9f17c6e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "scripts": { "create-patch": "node tools/create-patch.js", - "prepare": "node tools/prepare-curated.js ed curated && node tools/prepare-packages.js curated packages", + "curate": "node tools/prepare-curated.js ed curated && node tools/prepare-packages.js curated packages", "test": "mocha --recursive", "test-css": "mocha --recursive test/css", "test-elements": "mocha --recursive test/elements",