From bf1674521774a9d63d64457042f62bf1cd353e8b Mon Sep 17 00:00:00 2001 From: Karen Li Date: Tue, 22 Jul 2025 17:16:10 -0400 Subject: [PATCH 1/4] Small change to test workflow --- .github/workflows/build-deploy.yml | 6 +++--- api/registry.npmjs.com/oidc.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 176ba55..c65e770 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -4,9 +4,9 @@ on: push: branches: - main - # pull_request: - # paths: - # - "api/**" + pull_request: + paths: + - "api/**" workflow_dispatch: permissions: diff --git a/api/registry.npmjs.com/oidc.yaml b/api/registry.npmjs.com/oidc.yaml index a40f396..d2b3fcc 100644 --- a/api/registry.npmjs.com/oidc.yaml +++ b/api/registry.npmjs.com/oidc.yaml @@ -5,7 +5,7 @@ paths: - registry.npmjs.org summary: Exchange OIDC id_token for npm registry token description: | - Exchanges a valid OIDC id_token (provided as a Bearer token) for a short-lived npm registry access token for the specified package. + Exchange a valid OIDC id_token (provided as a Bearer token) for a short-lived npm registry access token for the specified package. **OIDC Token Requirements:** - The Bearer token must be an OIDC id_token from a supported Identity Provider (IdP) From 0c651c1ce42a617dfe6aa649c48b616bd62180ea Mon Sep 17 00:00:00 2001 From: Karen Li Date: Thu, 24 Jul 2025 13:26:43 -0400 Subject: [PATCH 2/4] Add lint check --- .github/workflows/validate.yml | 36 ++++++++++++++++++++++++++++++++++ api/base.yaml | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..54305b5 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,36 @@ +name: Validate OpenAPI Spec + +on: + push: + branches: + - main + paths: + - "api/**" + pull_request: + paths: + - "api/**" + workflow_dispatch: + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install dependencies + run: npm ci + + - name: Generate OpenAPI spec + run: npm run generate + + - name: Validate OpenAPI spec + run: npm run validate diff --git a/api/base.yaml b/api/base.yaml index 4fbb4ab..6a9047e 100644 --- a/api/base.yaml +++ b/api/base.yaml @@ -15,10 +15,12 @@ servers: tags: - name: Introduction x-displayName: Introduction + description: | This is the API documentation for the npm registry. For information about the npm registry, website, and command-line interface, please refer to [https://docs.npmjs.com](https://docs.npmjs.com). - name: registry.npmjs.org x-displayName: registry.npmjs.org + description: | API endpoints for the npm registry endpoint at `registry.npmjs.org`. From 54e4ea2f15b4c6e3393655f17e70bcbae673d1ac Mon Sep 17 00:00:00 2001 From: Karen Li Date: Thu, 24 Jul 2025 13:30:10 -0400 Subject: [PATCH 3/4] Add invalid base.yaml for test --- api/base.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/base.yaml b/api/base.yaml index 6a9047e..896996f 100644 --- a/api/base.yaml +++ b/api/base.yaml @@ -15,14 +15,13 @@ servers: tags: - name: Introduction x-displayName: Introduction - description: | This is the API documentation for the npm registry. For information about the npm registry, website, and command-line interface, please refer to [https://docs.npmjs.com](https://docs.npmjs.com). - name: registry.npmjs.org x-displayName: registry.npmjs.org - description: | API endpoints for the npm registry endpoint at `registry.npmjs.org`. + asd components: securitySchemes: From 33456ca1b40309577187e5b76aa519b1d338ead7 Mon Sep 17 00:00:00 2001 From: Karen Li Date: Thu, 24 Jul 2025 13:57:18 -0400 Subject: [PATCH 4/4] Add linting ci --- .github/workflows/{validate.yml => ci.yml} | 16 +++++----------- api/base.yaml | 1 - 2 files changed, 5 insertions(+), 12 deletions(-) rename .github/workflows/{validate.yml => ci.yml} (56%) diff --git a/.github/workflows/validate.yml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/validate.yml rename to .github/workflows/ci.yml index 54305b5..08e40c7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,12 @@ -name: Validate OpenAPI Spec +name: CI on: + pull_request: push: branches: - main paths: - "api/**" - pull_request: - paths: - - "api/**" - workflow_dispatch: permissions: contents: read @@ -18,16 +15,13 @@ jobs: validate: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: "20" - - name: Install dependencies - run: npm ci + - run: npm ci - name: Generate OpenAPI spec run: npm run generate diff --git a/api/base.yaml b/api/base.yaml index 896996f..4fbb4ab 100644 --- a/api/base.yaml +++ b/api/base.yaml @@ -21,7 +21,6 @@ tags: x-displayName: registry.npmjs.org description: | API endpoints for the npm registry endpoint at `registry.npmjs.org`. - asd components: securitySchemes: