From 6c7fcd4a023253bd4263d0a2119b20c4dd9a677e Mon Sep 17 00:00:00 2001 From: Santi Quiroga Date: Thu, 19 Nov 2026 19:51:45 +0000 Subject: [PATCH] chore: refine HTTP checks and schedule for generate-readme --- .github/workflows/update-api-list.yaml | 11 +++++++++-- README.md | 2 +- bin/README.mustache | 2 +- bin/generate-readme.mjs | 12 ++++++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-api-list.yaml b/.github/workflows/update-api-list.yaml index f3de95b03860..66a7b315c42a 100644 --- a/.github/workflows/update-api-list.yaml +++ b/.github/workflows/update-api-list.yaml @@ -1,14 +1,21 @@ +name: Update API List + permissions: contents: read +concurrency: + group: update-api-list + cancel-in-progress: false + on: schedule: - - cron: "0 1 * * *" + - cron: "0 1 * * 1" workflow_dispatch: jobs: update-api-list: runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: read issues: write # Added for creating issues on failure @@ -44,5 +51,5 @@ jobs: uses: googleapis/librarian/.github/actions/create-issue-on-failure@baf9b8078c5e98cb90b53088f284fb7b060e195b # main with: title: "Update API list failed" - body: "The daily scheduled task to update the API list failed." + body: "The weekly scheduled task to update the API list failed." mention: "@googleapis/cloud-sdk-nodejs-team" diff --git a/README.md b/README.md index e191f00908aa..d90671fc02ee 100644 --- a/README.md +++ b/README.md @@ -313,7 +313,7 @@ best-efforts basis with the following warnings: Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. -For example, `{{ metadata['lib_install_cmd'] }}@legacy-10` installs client libraries +For example, `npm install @google-cloud/@legacy-10` installs client libraries for versions compatible with Node.js 10. ## Versioning diff --git a/bin/README.mustache b/bin/README.mustache index 3783c55a91af..c357203875bb 100644 --- a/bin/README.mustache +++ b/bin/README.mustache @@ -67,7 +67,7 @@ best-efforts basis with the following warnings: Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. -For example, `{{ metadata['lib_install_cmd'] }}@legacy-10` installs client libraries +For example, `npm install @google-cloud/@legacy-10` installs client libraries for versions compatible with Node.js 10. ## Versioning diff --git a/bin/generate-readme.mjs b/bin/generate-readme.mjs index d34a1dd866e8..aad5645b2fe0 100755 --- a/bin/generate-readme.mjs +++ b/bin/generate-readme.mjs @@ -35,6 +35,11 @@ const github = new Gaxios({ retries: 3 } }); +const npmRegistry = new Gaxios({ + retryConfig: { + retries: 3 + } +}); function checkpoint (message, success = true) { const prefix = success ? chalk.green(figures.tick) : chalk.red(figures.cross); @@ -88,7 +93,7 @@ async function downloadRepoMetadata () { continue; } try { - await github.request({ + await npmRegistry.request({ url: `https://registry.npmjs.org/${packageName}`, method: 'HEAD' }); @@ -166,8 +171,11 @@ async function processMetadata (repoMetadata) { method: 'HEAD', validateStatus: () => true }); + if (res.status === 404) { + remoteUrlExists = false; + } } catch (err) { - if (err.status === 404) { + if (err.status === 404 || err.response?.status === 404) { remoteUrlExists = false; } }