From 32da04c9ca93e5301bfe5a49a913f118cb49f136 Mon Sep 17 00:00:00 2001 From: amagan Date: Tue, 7 Jul 2026 11:38:35 +0200 Subject: [PATCH 1/4] chore: bootstrap OSS NPM repository Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- .github/workflows/code-PR_verify-fallback.yml | 15 + .github/workflows/code-npm_node-PR_verify.yml | 146 +++++ ...-npm_node-publish-release-and-snapshot.yml | 497 ++++++++++++++++++ .../code-npm_node-sonarcloud-analysis.yml | 152 ++++++ .github/workflows/code-release_preview.yml | 154 ++++++ .gitignore | 9 + .npmrc | 2 + .tool-versions | 1 + CHANGELOG.md | 18 + README.md | 26 +- REUSE.toml | 10 +- 12 files changed, 1007 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/code-PR_verify-fallback.yml create mode 100644 .github/workflows/code-npm_node-PR_verify.yml create mode 100644 .github/workflows/code-npm_node-publish-release-and-snapshot.yml create mode 100644 .github/workflows/code-npm_node-sonarcloud-analysis.yml create mode 100644 .github/workflows/code-release_preview.yml create mode 100644 .npmrc create mode 100644 .tool-versions create mode 100644 CHANGELOG.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8e990a9..fc5e448 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,4 +5,4 @@ # Default reviewers -* @InditexTech/base-archetype-maintainers \ No newline at end of file +* @InditexTech/oso-admins \ No newline at end of file diff --git a/.github/workflows/code-PR_verify-fallback.yml b/.github/workflows/code-PR_verify-fallback.yml new file mode 100644 index 0000000..a5beb30 --- /dev/null +++ b/.github/workflows/code-PR_verify-fallback.yml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 +--- +name: code-PR-verify-fallback + +on: + pull_request: + +jobs: + unit-tests: + if: 'false' + name: Code / Verify + runs-on: ubuntu-24.04 + steps: + - run: echo "No Code / Verify required" diff --git a/.github/workflows/code-npm_node-PR_verify.yml b/.github/workflows/code-npm_node-PR_verify.yml new file mode 100644 index 0000000..ccf5f6e --- /dev/null +++ b/.github/workflows/code-npm_node-PR_verify.yml @@ -0,0 +1,146 @@ +# SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 +--- +name: code-npm-PR-verify + +concurrency: + group: code-PR-verify-${{ github.event.pull_request.number }} + cancel-in-progress: true + +on: + pull_request: + paths: + - "package.json" + - "package-lock.json" + - ".npmrc" + - ".tool-versions" + - "CHANGELOG.md" + - "src/**" + - "types/**" + - "example/**" + - "*.config.*" + - ".prettier*" + - ".github/workflows/code*" + types: [opened, synchronize, ready_for_review, reopened] + +jobs: + unit-tests: + name: Code / Verify + timeout-minutes: 60 + runs-on: ubuntu-24.04 + env: + ASDF_BRANCH_VERSION: 0.18.0 + steps: + - name: Validate admin permissions + id: permission-check + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + with: + script: | + const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ + owner: context.repo.owner, + repo: context.repo.repo, + username: context.actor + }); + + const permission = data.permission; + core.info(`User permission level: ${permission}`); + + if (permission !== "admin") { + core.setFailed(`User @${context.actor} is not a repository admin.`); + } + + - name: Checkout / Branch Head + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Detect NPM project + id: project + run: | + if [ -f package.json ]; then + echo "has-package=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::package.json is not present yet; skipping NPM verification for the OSS shell PR." + echo "has-package=false" >> "$GITHUB_OUTPUT" + fi + + - name: NPM / Setup Dependencies Cache + if: steps.project.outputs.has-package == 'true' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: asdf / Setup Dependencies Cache + if: steps.project.outputs.has-package == 'true' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + id: asdf-cache + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ env.ASDF_BRANCH_VERSION }}-${{ hashFiles('.tool-versions') }} + + - name: Validate tool-versions content + if: steps.project.outputs.has-package == 'true' + run: | + if [ ! -f .tool-versions ]; then + echo "::error::.tool-versions is required for NPM workflows" + exit 1 + fi + if grep -Evq '^[a-zA-Z0-9_-]+ [a-zA-Z0-9._+-]+$' .tool-versions; then + echo "::error::Invalid .tool-versions content detected" + exit 1 + fi + + - name: Save tool-versions content + if: steps.project.outputs.has-package == 'true' + run: | + { + echo "TOOL_VERSIONS<> "$GITHUB_ENV" + + - name: NPM / Setup asdf environment + if: steps.project.outputs.has-package == 'true' && steps.asdf-cache.outputs.cache-hit != 'true' + uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0 + with: + tool_versions: ${{ env.TOOL_VERSIONS }} + asdf_version: ${{ env.ASDF_BRANCH_VERSION }} + + - name: Restore asdf shims to PATH + if: steps.project.outputs.has-package == 'true' && steps.asdf-cache.outputs.cache-hit == 'true' + run: | + echo "$HOME/.asdf/bin" >> "$GITHUB_PATH" + echo "$HOME/.asdf/shims" >> "$GITHUB_PATH" + cp .tool-versions "$HOME/.tool-versions" + + - name: NPM / Set npmrc registry + if: steps.project.outputs.has-package == 'true' + env: + NPM_REGISTRY: "https://registry.npmjs.org/" + run: | + echo "registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + echo "@inditextech:registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + + - name: NPM / Create Cache Folders + if: steps.project.outputs.has-package == 'true' + run: mkdir -p "$HOME"/.npm + + - name: NPM / Install dependencies + if: steps.project.outputs.has-package == 'true' + run: npm ci + + - name: NPM / Verify + if: steps.project.outputs.has-package == 'true' + run: npm run verify + + - name: Store project information + if: steps.project.outputs.has-package == 'true' + id: version + run: | + echo "app-version=$(jq -r ".version" package.json)" >> "$GITHUB_OUTPUT" + echo "app-name=$(jq -r ".name" package.json)" >> "$GITHUB_OUTPUT" + echo "github-repository=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/code-npm_node-publish-release-and-snapshot.yml b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml new file mode 100644 index 0000000..56f87e7 --- /dev/null +++ b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml @@ -0,0 +1,497 @@ +# SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 +--- +name: code-npm-publish-release-and-snapshot +run-name: "Publish workflow: ${{ github.event_name }}" + +on: + issue_comment: + types: [created] + pull_request: + types: [closed] + branches: ["main", "main-*"] + paths: + - "package.json" + - "package-lock.json" + - "CHANGELOG.md" + - "src/**" + - "types/**" + - "example/**" + - ".github/workflows/code**" + workflow_dispatch: + inputs: + BASELINE: + description: "Baseline branch" + required: true + default: "main" + RELEASE_TYPE: + description: "Release type to use" + required: true + default: "release-type/minor" + type: choice + options: + - "release-type/hotfix" + - "release-type/multi-hotfix" + - "release-type/major" + - "release-type/minor" + - "release-type/patch" + +env: + ASDF_BRANCH_VERSION: 0.18.0 + NPM_REGISTRY: "https://registry.npmjs.org/" + +jobs: + publish-snapshot: + name: Publish Snapshot + concurrency: code-publish-snapshot-${{ github.ref }} + permissions: + id-token: write + contents: read + issues: write + pull-requests: write + if: > + github.event_name == 'issue_comment' && + github.event.issue.pull_request != null && + github.event.comment.body == '/publish-snapshot' + runs-on: ubuntu-24.04 + steps: + - name: Validate admin permissions + id: permission-check + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + with: + script: | + const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ + owner: context.repo.owner, + repo: context.repo.repo, + username: context.actor + }); + + const permission = data.permission; + core.info(`User permission level: ${permission}`); + + if (permission !== "admin") { + core.setFailed(`User @${context.actor} is not a repository admin.`); + } + + - name: Checkout PR branch + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + ref: refs/pull/${{ github.event.issue.number }}/head + fetch-depth: 0 + persist-credentials: false + + - name: Validate NPM project + run: | + if [ ! -f package.json ]; then + echo "::error::package.json is required to publish an NPM snapshot" + exit 1 + fi + if [ ! -f package-lock.json ]; then + echo "::error::package-lock.json is required to publish an NPM snapshot" + exit 1 + fi + + - name: NPM / Setup Dependencies Cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Restore asdf Cache + id: asdf-cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + continue-on-error: true + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ env.ASDF_BRANCH_VERSION }}-${{ hashFiles('.tool-versions') }} + + - name: Save tool-versions content + run: | + { + echo "TOOL_VERSIONS<> "$GITHUB_ENV" + + - name: Setup asdf environment + uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0 + if: steps.asdf-cache.outputs.cache-hit != 'true' + with: + tool_versions: ${{ env.TOOL_VERSIONS }} + asdf_version: ${{ env.ASDF_BRANCH_VERSION }} + + - name: Restore asdf shims to PATH + if: steps.asdf-cache.outputs.cache-hit == 'true' + run: | + echo "$HOME/.asdf/bin" >> "$GITHUB_PATH" + echo "$HOME/.asdf/shims" >> "$GITHUB_PATH" + cp .tool-versions "$HOME/.tool-versions" + + - name: NPM / Set npmrc registry + run: | + echo "registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + echo "@inditextech:registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + + - name: NPM / Create Cache Folders + run: mkdir -p "$HOME"/.npm + + - name: NPM / Install dependencies + run: npm ci + + - name: NPM / Verify + run: npm run verify + + - name: Define snapshot version + run: | + BASE_VERSION=$(node -p "require('./package.json').version.replace(/-.*/, '')") + SNAPSHOT_VERSION="${BASE_VERSION}-SNAPSHOT.${{ github.run_number }}.${{ github.run_attempt }}" + echo "SNAPSHOT_VERSION=$SNAPSHOT_VERSION" >> "$GITHUB_ENV" + + - name: NPM / Prepare snapshot + env: + SNAPSHOT_VERSION: ${{ env.SNAPSHOT_VERSION }} + run: | + npm version "$SNAPSHOT_VERSION" --no-git-tag-version + npm run release:prepare --if-present + npm run build --if-present + + - name: NPM / Ensure minimum npm version for trusted publishing + run: | + CURRENT_NPM=$(npm --version) + REQUIRED_NPM="11.5.1" + if printf '%s\n%s\n' "$REQUIRED_NPM" "$CURRENT_NPM" | sort -V -C; then + echo "npm $CURRENT_NPM already meets the minimum requirement ($REQUIRED_NPM). Skipping upgrade." + else + echo "npm $CURRENT_NPM is below the minimum requirement ($REQUIRED_NPM). Upgrading..." + npm install -g npm@^11.5.1 --registry="${NPM_REGISTRY}" + asdf reshim nodejs + fi + node --version + npm --version + + - name: NPM / Verify package exists in registry + id: verify-package + run: | + PKG_NAME=$(node -p "require('./package.json').name") + ENCODED_PKG_NAME=$(node -p "encodeURIComponent(process.argv[1])" "$PKG_NAME") + RESPONSE_FILE=$(mktemp) + if ! HTTP_STATUS=$(curl -sS -o "$RESPONSE_FILE" -w "%{http_code}" \ + --connect-timeout 10 \ + --max-time 30 \ + --retry 3 \ + --retry-delay 2 \ + --retry-all-errors \ + "${NPM_REGISTRY}${ENCODED_PKG_NAME}"); then + echo "::error::Failed to verify $PKG_NAME due to npm registry connectivity error" + rm -f "$RESPONSE_FILE" + exit 1 + fi + case "$HTTP_STATUS" in + 200) + echo "HAS_NEW_PACKAGE=false" >> "$GITHUB_ENV" + ;; + 404) + echo "::warning::$PKG_NAME is not present in the npm registry; NPM_TOKEN will be required" + echo "HAS_NEW_PACKAGE=true" >> "$GITHUB_ENV" + ;; + 429|5??) + echo "::error::Failed to verify $PKG_NAME due to transient npm registry error (HTTP $HTTP_STATUS)" + exit 1 + ;; + *) + echo "::error::Failed to verify $PKG_NAME due to unexpected npm registry response (HTTP $HTTP_STATUS)" + exit 1 + ;; + esac + rm -f "$RESPONSE_FILE" + + - name: NPM / Publish Snapshot (OIDC + provenance) + if: env.HAS_NEW_PACKAGE == 'false' + env: + NPM_CONFIG_PROVENANCE: "true" + run: npm publish --tag next --access public + + - name: NPM / Publish Snapshot (NPM_TOKEN for new packages) + if: env.HAS_NEW_PACKAGE == 'true' + env: + NPM_AUTH: ${{ secrets.NPM_TOKEN }} + run: | + if [ -z "${NPM_AUTH:-}" ]; then + echo "::error::NPM_TOKEN secret is required for publishing new packages but is not set" + exit 1 + fi + TEMP_NPMRC="$(mktemp)" + trap 'rm -f "$TEMP_NPMRC"' EXIT + cp "$HOME/.npmrc" "$TEMP_NPMRC" + chmod 600 "$TEMP_NPMRC" + echo "//registry.npmjs.org/:_authToken=${NPM_AUTH}" >> "$TEMP_NPMRC" + export NPM_CONFIG_USERCONFIG="$TEMP_NPMRC" + npm publish --tag next --access public + + - name: Result / Comment on PR + if: always() + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + with: + script: | + const status = '${{ job.status }}'; + const authMethod = '${{ env.HAS_NEW_PACKAGE }}' === 'true' + ? 'NPM_TOKEN (new package detected)' + : 'OIDC trusted publishing (provenance)'; + + const body = status === 'success' + ? [ + '### :rocket: NPM snapshot published', + '', + `- Version: \`${process.env.SNAPSHOT_VERSION}\``, + '- Tag: `next`', + `- Auth: ${authMethod}` + ] + : [ + '### :x: NPM snapshot publication failed', + '', + 'Please check the workflow logs for details.' + ]; + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body.join('\n') + }); + + release: + name: Release + concurrency: code-release-${{ github.ref }} + permissions: + id-token: write + contents: write + issues: write + pull-requests: write + if: github.event_name == 'workflow_dispatch' + || (github.event_name == 'pull_request' && github.event.pull_request.merged == true + && !contains(join(github.event.pull_request.labels.*.name, ', '), 'skip-release') + && (contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') + || vars.DEVELOPMENT_FLOW == 'trunk-based-development' )) + runs-on: ubuntu-24.04 + steps: + - name: Validate admin permissions + id: permission-check + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 + with: + script: | + const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ + owner: context.repo.owner, + repo: context.repo.repo, + username: context.actor + }); + + const permission = data.permission; + core.info(`User permission level: ${permission}`); + + if (permission !== "admin") { + core.setFailed(`User @${context.actor} is not a repository admin.`); + } + + - name: Get input parameters + run: | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + RELEASE_LABELS="${{ github.event.inputs.RELEASE_TYPE }}" + else + RELEASE_LABELS="${{ join(github.event.pull_request.labels.*.name, ', ') }}" + if [[ $RELEASE_LABELS != *release-type/* ]]; then + RELEASE_LABELS="$RELEASE_LABELS, release-type/minor" + fi + fi + echo "RELEASE_LABELS=$RELEASE_LABELS" >> "$GITHUB_ENV" + BASELINE_BRANCH=${{ github.event.inputs.BASELINE || github.ref }} + echo "BASELINE_BRANCH=${BASELINE_BRANCH#refs/heads/}" >> "$GITHUB_ENV" + + - name: Checkout merge commit + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + ref: ${{ env.BASELINE_BRANCH }} + fetch-depth: 0 + persist-credentials: true + + - name: Validate NPM project + run: | + if [ ! -f package.json ]; then + echo "::error::package.json is required to release the NPM package" + exit 1 + fi + if [ ! -f package-lock.json ]; then + echo "::error::package-lock.json is required to release the NPM package" + exit 1 + fi + + - name: NPM / Setup Dependencies Cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Restore asdf Cache + id: asdf-cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + continue-on-error: true + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ env.ASDF_BRANCH_VERSION }}-${{ hashFiles('.tool-versions') }} + + - name: Save tool-versions content + run: | + { + echo "TOOL_VERSIONS<> "$GITHUB_ENV" + + - name: Setup asdf environment + uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0 + if: steps.asdf-cache.outputs.cache-hit != 'true' + with: + tool_versions: ${{ env.TOOL_VERSIONS }} + asdf_version: ${{ env.ASDF_BRANCH_VERSION }} + + - name: Restore asdf shims to PATH + if: steps.asdf-cache.outputs.cache-hit == 'true' + run: | + echo "$HOME/.asdf/bin" >> "$GITHUB_PATH" + echo "$HOME/.asdf/shims" >> "$GITHUB_PATH" + cp .tool-versions "$HOME/.tool-versions" + + - name: NPM / Set npmrc registry + run: | + echo "registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + echo "@inditextech:registry=${NPM_REGISTRY}" >> "$HOME/.npmrc" + + - name: NPM / Create Cache Folders + run: mkdir -p "$HOME"/.npm + + - name: Setup patch release type version + if: contains(env.RELEASE_LABELS, 'release-type/hotfix') || contains(env.RELEASE_LABELS, 'release-type/multi-hotfix') || contains(env.RELEASE_LABELS, 'release-type/patch') + run: echo "RELEASE_VERSION=patch" >> "$GITHUB_ENV" + + - name: Setup minor release type version + if: contains(env.RELEASE_LABELS, 'release-type/minor') + run: echo "RELEASE_VERSION=minor" >> "$GITHUB_ENV" + + - name: Setup minor release type version when no label set and TBD + if: ${{ !contains(env.RELEASE_LABELS, 'release-type') && vars.DEVELOPMENT_FLOW == 'trunk-based-development' }} + run: echo "RELEASE_VERSION=minor" >> "$GITHUB_ENV" + + - name: Setup major release type version + if: contains(env.RELEASE_LABELS, 'release-type/major') + run: echo "RELEASE_VERSION=major" >> "$GITHUB_ENV" + + - name: NPM / Install dependencies + run: npm ci + + - name: NPM / Verify + run: npm run verify + + - name: Update CHANGELOG.md + id: update-changelog + uses: release-flow/keep-a-changelog-action@74931dec7ecdbfc8e38ac9ae7e8dd84c08db2f32 # v3.0.0 + with: + command: bump + version: ${{ env.RELEASE_VERSION }} + changelog: CHANGELOG.md + fail-on-empty-release-notes: false + keep-unreleased-section: true + tag-prefix: "" + + - name: NPM / Prepare release + env: + RELEASE_VERSION: ${{ steps.update-changelog.outputs.version }} + run: | + npm version "$RELEASE_VERSION" --no-git-tag-version + npm run release:prepare --if-present + npm run build --if-present + + - name: NPM / Ensure minimum npm version for trusted publishing + run: | + CURRENT_NPM=$(npm --version) + REQUIRED_NPM="11.5.1" + if printf '%s\n%s\n' "$REQUIRED_NPM" "$CURRENT_NPM" | sort -V -C; then + echo "npm $CURRENT_NPM already meets the minimum requirement ($REQUIRED_NPM). Skipping upgrade." + else + echo "npm $CURRENT_NPM is below the minimum requirement ($REQUIRED_NPM). Upgrading..." + npm install -g npm@^11.5.1 --registry="${NPM_REGISTRY}" + asdf reshim nodejs + fi + node --version + npm --version + + - name: NPM / Verify package exists in registry + run: | + PKG_NAME=$(node -p "require('./package.json').name") + ENCODED_PKG_NAME=$(node -p "encodeURIComponent(process.argv[1])" "$PKG_NAME") + RESPONSE_FILE=$(mktemp) + if ! HTTP_STATUS=$(curl -sS -o "$RESPONSE_FILE" -w "%{http_code}" \ + --connect-timeout 10 \ + --max-time 30 \ + --retry 3 \ + --retry-delay 2 \ + --retry-all-errors \ + "${NPM_REGISTRY}${ENCODED_PKG_NAME}"); then + echo "::error::Failed to verify $PKG_NAME due to npm registry connectivity error" + rm -f "$RESPONSE_FILE" + exit 1 + fi + case "$HTTP_STATUS" in + 200) + echo "HAS_NEW_PACKAGE=false" >> "$GITHUB_ENV" + ;; + 404) + echo "::warning::$PKG_NAME is not present in the npm registry; NPM_TOKEN will be required" + echo "HAS_NEW_PACKAGE=true" >> "$GITHUB_ENV" + ;; + 429|5??) + echo "::error::Failed to verify $PKG_NAME due to transient npm registry error (HTTP $HTTP_STATUS)" + exit 1 + ;; + *) + echo "::error::Failed to verify $PKG_NAME due to unexpected npm registry response (HTTP $HTTP_STATUS)" + exit 1 + ;; + esac + rm -f "$RESPONSE_FILE" + + - name: Commit release metadata + env: + RELEASE_VERSION: ${{ steps.update-changelog.outputs.version }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add CHANGELOG.md package.json package-lock.json + git commit -m "chore(release): ${RELEASE_VERSION}" || echo "No release metadata changes to commit" + git tag "${RELEASE_VERSION}" + git push origin "HEAD:${BASELINE_BRANCH}" --follow-tags + + - name: NPM / Publish Release (OIDC + provenance) + if: env.HAS_NEW_PACKAGE == 'false' + env: + NPM_CONFIG_PROVENANCE: "true" + run: npm publish --access public + + - name: NPM / Publish Release (NPM_TOKEN for new packages) + if: env.HAS_NEW_PACKAGE == 'true' + env: + NPM_AUTH: ${{ secrets.NPM_TOKEN }} + run: | + if [ -z "${NPM_AUTH:-}" ]; then + echo "::error::NPM_TOKEN secret is required for publishing new packages but is not set" + exit 1 + fi + TEMP_NPMRC="$(mktemp)" + trap 'rm -f "$TEMP_NPMRC"' EXIT + cp "$HOME/.npmrc" "$TEMP_NPMRC" + chmod 600 "$TEMP_NPMRC" + echo "//registry.npmjs.org/:_authToken=${NPM_AUTH}" >> "$TEMP_NPMRC" + export NPM_CONFIG_USERCONFIG="$TEMP_NPMRC" + npm publish --access public diff --git a/.github/workflows/code-npm_node-sonarcloud-analysis.yml b/.github/workflows/code-npm_node-sonarcloud-analysis.yml new file mode 100644 index 0000000..e0a635f --- /dev/null +++ b/.github/workflows/code-npm_node-sonarcloud-analysis.yml @@ -0,0 +1,152 @@ +# SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 +--- +name: code-npm-sonarcloud-analysis +run-name: SonarCloud analysis on ${{ github.head_ref || github.ref_name }} branch + +concurrency: + group: sonarcloud-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] + branches: ["develop", "develop-*", "main", "main-*"] + paths: + - "package.json" + - "package-lock.json" + - ".tool-versions" + - "src/**" + - "types/**" + - "example/**" + - ".github/workflows/code-*-sonarcloud-analysis.yml" + release: + types: + - published + +env: + ASDF_BRANCH_VERSION: 0.18.0 + +jobs: + unit-tests: + name: SonarCloud / Unit Tests + permissions: + contents: read + timeout-minutes: 30 + if: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.event_name == 'release') && vars.IS_INDITEXTECH_REPO == 'true' }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 0 + + - name: Detect NPM project + id: project + run: | + if [ -f package.json ]; then + echo "has-package=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::package.json is not present yet; skipping SonarCloud analysis for the OSS shell PR." + echo "has-package=false" >> "$GITHUB_OUTPUT" + fi + + - name: NPM / Setup Dependencies Cache + if: steps.project.outputs.has-package == 'true' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: asdf / Setup Dependencies Cache + if: steps.project.outputs.has-package == 'true' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 + id: asdf-cache + with: + path: ~/.asdf + key: ${{ runner.os }}-asdf-${{ env.ASDF_BRANCH_VERSION }}-${{ hashFiles('.tool-versions') }} + + - name: Save tool-versions content + if: steps.project.outputs.has-package == 'true' + run: | + { + echo "TOOL_VERSIONS<> "$GITHUB_ENV" + + - name: NPM / Setup asdf environment + if: steps.project.outputs.has-package == 'true' && steps.asdf-cache.outputs.cache-hit != 'true' + uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0 + with: + tool_versions: ${{ env.TOOL_VERSIONS }} + asdf_version: ${{ env.ASDF_BRANCH_VERSION }} + + - name: Restore asdf shims to PATH + if: steps.project.outputs.has-package == 'true' && steps.asdf-cache.outputs.cache-hit == 'true' + run: | + echo "$HOME/.asdf/bin" >> "$GITHUB_PATH" + echo "$HOME/.asdf/shims" >> "$GITHUB_PATH" + cp .tool-versions "$HOME/.tool-versions" + + - name: NPM / Install dependencies + if: steps.project.outputs.has-package == 'true' + run: npm ci + + - name: NPM / Build package + if: steps.project.outputs.has-package == 'true' + run: npm run build --if-present + + - name: NPM / Run unit tests with coverage + if: steps.project.outputs.has-package == 'true' + continue-on-error: true + run: npm run test:coverage --if-present + + - name: Store project information + if: steps.project.outputs.has-package == 'true' + id: version + run: | + echo "app-version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT" + echo "app-name=$(jq -r '.name' package.json)" >> "$GITHUB_OUTPUT" + echo "github-repository=$(echo "$GITHUB_REPOSITORY" | cut -d'/' -f2)" >> "$GITHUB_OUTPUT" + + - name: SonarCloud / Run analysis with release event + if: ${{ steps.project.outputs.has-package == 'true' && github.event_name == 'release' }} + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + npx sonar-scanner \ + -Dsonar.host.url="https://sonarcloud.io/" \ + -Dsonar.organization=inditextech \ + -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.github-repository }}" \ + -Dsonar.projectName="${{ steps.version.outputs.github-repository }}" \ + -Dsonar.projectVersion="${{ github.event.release.tag_name }}" \ + -Dsonar.branch.name="release/${{ github.event.release.tag_name }}" \ + -Dsonar.sources=src \ + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info + + - name: SonarCloud / Run analysis + if: ${{ steps.project.outputs.has-package == 'true' && github.event_name != 'release' }} + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + SCOPE_OPTIONS="-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }}" + else + SCOPE_OPTIONS="-Dsonar.branch.name=${{ github.ref_name }}" + fi + + npx sonar-scanner \ + -Dsonar.host.url="https://sonarcloud.io/" \ + -Dsonar.organization=inditextech \ + -Dsonar.projectKey=InditexTech_"${{ steps.version.outputs.github-repository }}" \ + -Dsonar.projectName="${{ steps.version.outputs.github-repository }}" \ + -Dsonar.projectVersion="${{ steps.version.outputs.app-version }}" \ + -Dsonar.sources=src \ + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info \ + $SCOPE_OPTIONS diff --git a/.github/workflows/code-release_preview.yml b/.github/workflows/code-release_preview.yml new file mode 100644 index 0000000..c53361a --- /dev/null +++ b/.github/workflows/code-release_preview.yml @@ -0,0 +1,154 @@ +# SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) +# SPDX-License-Identifier: Apache-2.0 +--- +name: code-release-preview + +concurrency: + group: release-preview + cancel-in-progress: true + +on: + pull_request: + types: [labeled, synchronize, ready_for_review, opened] + branches: ["main", "main-*"] + +env: + PR_HEAD_REF: ${{ github.head_ref }} + +jobs: + check-changes-in-paths: + name: Check for changes in corresponding paths + runs-on: ubuntu-24.04 + if: ${{ github.event.pull_request.draft == false || contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') || contains(join(github.event.pull_request.labels.*.name, ', '), 'release-preview') }} + outputs: + detected: ${{ steps.changes.outputs.paths }} + steps: + - name: Check for changed files in specific paths + id: changes + uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a + with: + filters: | + paths: + - "package.json" + - "package-lock.json" + - "CHANGELOG.md" + - "src/**" + - "types/**" + - "example/**" + - ".github/workflows/code*" + + release-preview: + name: Release Preview + needs: check-changes-in-paths + if: ${{ (contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') || contains(join(github.event.pull_request.labels.*.name, ', '), 'release-preview')) && needs.check-changes-in-paths.outputs.detected == 'true' }} + runs-on: ubuntu-24.04 + steps: + - name: Checkout merge commit + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup patch release type version + if: contains(github.event.pull_request.labels.*.name, 'release-type/hotfix') || contains(github.event.pull_request.labels.*.name, 'release-type/multi-hotfix') || contains(github.event.pull_request.labels.*.name, 'release-type/patch') + run: echo "RELEASE_VERSION=patch" >> "$GITHUB_ENV" + + - name: Setup minor release type version + if: contains(github.event.pull_request.labels.*.name, 'release-type/minor') + run: echo "RELEASE_VERSION=minor" >> "$GITHUB_ENV" + + - name: Setup major release type version + if: contains(github.event.pull_request.labels.*.name, 'release-type/major') + run: echo "RELEASE_VERSION=major" >> "$GITHUB_ENV" + + - name: Check merge strategy + run: | + if [[ "$PR_HEAD_REF" == hotfix* && "${{ contains(github.event.pull_request.labels.*.name, 'release-type/multi-hotfix') }}" != "true" ]]; then + echo "MERGE_STRATEGY=Squash and Merge" >> "$GITHUB_ENV" + elif [[ "${{ vars.DEVELOPMENT_FLOW }}" == "trunk-based-development" ]]; then + echo "MERGE_STRATEGY=Squash and Merge" >> "$GITHUB_ENV" + else + echo "MERGE_STRATEGY=Create a merge commit" >> "$GITHUB_ENV" + fi + + - name: Check if CHANGELOG.md has changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if git diff --quiet HEAD^ HEAD -- CHANGELOG.md; then + echo "::error title={No CHANGELOG.md changes}::{No CHANGELOG.md changes were found. Update the Unreleased section with the new changes.}" + gh pr comment ${{ github.event.number }} --body "### :x: No CHANGELOG.md changes + + No changes were found in CHANGELOG.md. Please update the Unreleased section with the changes that apply to this release." + exit 1 + fi + + - name: Update CHANGELOG.md + id: update-changelog + uses: release-flow/keep-a-changelog-action@74931dec7ecdbfc8e38ac9ae7e8dd84c08db2f32 # v3.0.0 + with: + command: bump + version: ${{ env.RELEASE_VERSION }} + changelog: CHANGELOG.md + fail-on-empty-release-notes: false + keep-unreleased-section: true + tag-prefix: "" + + - name: Add PR comment with release preview + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TASKS=$(awk -v version="${{ steps.update-changelog.outputs.version }}" ' + BEGIN { capture=0; found_version=0 } + $0 ~ "## \\[" version "\\] -" { capture=1; found_version=1; print; next } + capture && $0 ~ /^## \[.*\] -/ { capture=0 } + capture { print } + END { + if (found_version) { + while ((getline line < "CHANGELOG.md") > 0) { + if (line ~ /^\[.*\]:/) { + print line + } + } + } + } + ' CHANGELOG.md) + MESSAGE=" + ### :rocket: Release Preview Success + You are going to release the version **${RELEASE_VERSION}** with the following changes: + $TASKS + + ### 💡 Merge Strategy: $MERGE_STRATEGY + + Remember to use the **'$MERGE_STRATEGY'** strategy to merge this Pull Request (\`$PR_HEAD_REF\` → \`${{ github.event.pull_request.base.ref }}\`). + " + + gh pr comment ${{ github.event.number }} --body "$(echo -e "$MESSAGE")" + + release-preview-no-code-changes: + name: Add PR comment with configuration management information + needs: check-changes-in-paths + if: ${{ (contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') || contains(join(github.event.pull_request.labels.*.name, ', '), 'release-preview')) && needs.check-changes-in-paths.outputs.detected == 'false' }} + runs-on: ubuntu-24.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Add PR comment with release preview + run: | + gh pr comment ${{ github.event.number }} --body "### :exclamation: This Pull Request will not trigger a release + + No package, source, example, changelog, or code workflow changes were detected." + + release-preview-no-release-labels: + name: Add PR comment with release information + needs: check-changes-in-paths + if: ${{ !contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') && needs.check-changes-in-paths.outputs.detected == 'true' && github.event.pull_request.draft == false && vars.DEVELOPMENT_FLOW != 'trunk-based-development' }} + runs-on: ubuntu-24.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Add PR comment with release preview + run: | + gh pr comment ${{ github.event.number }} --body "### :exclamation: This Pull Request will not trigger a release + + A Pull Request with no \`release-type/...\` labels will not trigger a release, so you need to label this PR if you want to create a release." diff --git a/.gitignore b/.gitignore index e69de29..58ddb2f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,9 @@ +node_modules/ +.npm/ + +dist/ +coverage/ +.nyc_output/ + +*.log +.DS_Store \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..805509b --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +registry=https://registry.npmjs.org/ +@inditextech:registry=https://registry.npmjs.org/ diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..9d70911 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 24.11.1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..012c2b0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ + + +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +- Initial OSS repository shell. diff --git a/README.md b/README.md index 16888fb..9622d3a 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,13 @@ SPDX-FileCopyrightText: 2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.) SPDX-License-Identifier: Apache-2.0 --> - -![GitHub License](https://img.shields.io/github/license/InditexTech/base-archetype) +![GitHub License](https://img.shields.io/github/license/InditexTech/swagger-ui-plugin-diff-highlight) -# base-archetype +# swagger-ui-plugin-diff-highlight -Short description of what this project does and why it exists. +Swagger UI plugin to highlight OpenAPI differences directly in rendered API documentation. -> One or two sentences that explain its purpose in a clear, accessible way. +> This repository contains the open source shell for the project. The implementation will be added by the project maintainers. @@ -25,20 +24,13 @@ Short description of what this project does and why it exists. ### Installation -Explain how to install or run the project. - ```bash -# Example for a CLI tool -npm install -g @inditextech/your-tool +npm install @inditextech/swagger-ui-plugin-diff-highlight ``` ### Usage -Show basic usage or link to examples. - -```bash -your-tool init -``` +Usage documentation will be added with the project implementation. ## Contributing @@ -46,12 +38,6 @@ We welcome contributions! Please read our [CONTRIBUTING.md](./CONTRIBUTING.md) and follow the [Code of Conduct](./CODE_OF_CONDUCT.md). -## Roadmap - -See [ROADMAP.md](./ROADMAP.md) for planned features and development goals. - - - ## Acknowledgments diff --git a/REUSE.toml b/REUSE.toml index 443a6dd..339805b 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -1,14 +1,16 @@ version = 1 -SPDX-PackageName = "base-archetype" -SPDX-PackageSupplier = "2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)" -SPDX-PackageDownloadLocation = "https://github.com/InditexTech/base-archetype" +SPDX-PackageName = "swagger-ui-plugin-diff-highlight" +SPDX-PackageSupplier = "2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)" +SPDX-PackageDownloadLocation = "https://github.com/InditexTech/swagger-ui-plugin-diff-highlight" [[annotations]] path = [ "repolinter.json", "NOTICE", ".gitignore", + ".npmrc", + ".tool-versions", ".github/CODEOWNERS", ] -SPDX-FileCopyrightText = "2025 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)" +SPDX-FileCopyrightText = "2026 INDUSTRIA DE DISEÑO TEXTIL S.A. (INDITEX S.A.)" SPDX-License-Identifier = "Apache-2.0" From 5dac19aba2ee52e5d8fdb0207a6a8db6210176a9 Mon Sep 17 00:00:00 2001 From: amagan Date: Tue, 7 Jul 2026 11:48:59 +0200 Subject: [PATCH 2/4] fix: make release preview comments repo-aware Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/code-release_preview.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-release_preview.yml b/.github/workflows/code-release_preview.yml index c53361a..f96c8f7 100644 --- a/.github/workflows/code-release_preview.yml +++ b/.github/workflows/code-release_preview.yml @@ -77,7 +77,7 @@ jobs: run: | if git diff --quiet HEAD^ HEAD -- CHANGELOG.md; then echo "::error title={No CHANGELOG.md changes}::{No CHANGELOG.md changes were found. Update the Unreleased section with the new changes.}" - gh pr comment ${{ github.event.number }} --body "### :x: No CHANGELOG.md changes + gh pr comment ${{ github.event.number }} --repo "$GITHUB_REPOSITORY" --body "### :x: No CHANGELOG.md changes No changes were found in CHANGELOG.md. Please update the Unreleased section with the changes that apply to this release." exit 1 @@ -123,7 +123,7 @@ jobs: Remember to use the **'$MERGE_STRATEGY'** strategy to merge this Pull Request (\`$PR_HEAD_REF\` → \`${{ github.event.pull_request.base.ref }}\`). " - gh pr comment ${{ github.event.number }} --body "$(echo -e "$MESSAGE")" + gh pr comment ${{ github.event.number }} --repo "$GITHUB_REPOSITORY" --body "$(echo -e "$MESSAGE")" release-preview-no-code-changes: name: Add PR comment with configuration management information @@ -135,7 +135,7 @@ jobs: steps: - name: Add PR comment with release preview run: | - gh pr comment ${{ github.event.number }} --body "### :exclamation: This Pull Request will not trigger a release + gh pr comment ${{ github.event.number }} --repo "$GITHUB_REPOSITORY" --body "### :exclamation: This Pull Request will not trigger a release No package, source, example, changelog, or code workflow changes were detected." @@ -149,6 +149,6 @@ jobs: steps: - name: Add PR comment with release preview run: | - gh pr comment ${{ github.event.number }} --body "### :exclamation: This Pull Request will not trigger a release + gh pr comment ${{ github.event.number }} --repo "$GITHUB_REPOSITORY" --body "### :exclamation: This Pull Request will not trigger a release A Pull Request with no \`release-type/...\` labels will not trigger a release, so you need to label this PR if you want to create a release." From fb6001141e1a3b154a7786fea1f18e5071e03f7d Mon Sep 17 00:00:00 2001 From: amagan Date: Tue, 7 Jul 2026 11:56:32 +0200 Subject: [PATCH 3/4] fix: gate NPM auto release until configured Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/code-npm_node-PR_verify.yml | 10 ++++++++- ...-npm_node-publish-release-and-snapshot.yml | 21 +++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-npm_node-PR_verify.yml b/.github/workflows/code-npm_node-PR_verify.yml index ccf5f6e..c05eeb8 100644 --- a/.github/workflows/code-npm_node-PR_verify.yml +++ b/.github/workflows/code-npm_node-PR_verify.yml @@ -135,7 +135,15 @@ jobs: - name: NPM / Verify if: steps.project.outputs.has-package == 'true' - run: npm run verify + run: | + if node -e "process.exit(require('./package.json').scripts?.verify ? 0 : 1)"; then + npm run verify + else + npm run lint --if-present + npm run format:check --if-present + npm run test --if-present + npm run build --if-present + fi - name: Store project information if: steps.project.outputs.has-package == 'true' diff --git a/.github/workflows/code-npm_node-publish-release-and-snapshot.yml b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml index 56f87e7..b05180e 100644 --- a/.github/workflows/code-npm_node-publish-release-and-snapshot.yml +++ b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml @@ -141,7 +141,15 @@ jobs: run: npm ci - name: NPM / Verify - run: npm run verify + run: | + if node -e "process.exit(require('./package.json').scripts?.verify ? 0 : 1)"; then + npm run verify + else + npm run lint --if-present + npm run format:check --if-present + npm run test --if-present + npm run build --if-present + fi - name: Define snapshot version run: | @@ -271,6 +279,7 @@ jobs: pull-requests: write if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true + && vars.NPM_PUBLISH_AUTOMATION_ENABLED == 'true' && !contains(join(github.event.pull_request.labels.*.name, ', '), 'skip-release') && (contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') || vars.DEVELOPMENT_FLOW == 'trunk-based-development' )) @@ -392,7 +401,15 @@ jobs: run: npm ci - name: NPM / Verify - run: npm run verify + run: | + if node -e "process.exit(require('./package.json').scripts?.verify ? 0 : 1)"; then + npm run verify + else + npm run lint --if-present + npm run format:check --if-present + npm run test --if-present + npm run build --if-present + fi - name: Update CHANGELOG.md id: update-changelog From 0b6346af97a6b859da3bac8defb3b28c934ec579 Mon Sep 17 00:00:00 2001 From: amagan Date: Tue, 7 Jul 2026 13:57:29 +0200 Subject: [PATCH 4/4] chore: align npm release configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- .../workflows/code-npm_node-publish-release-and-snapshot.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fc5e448..a5dc340 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,4 +5,4 @@ # Default reviewers -* @InditexTech/oso-admins \ No newline at end of file +* @InditexTech/swagger-ui-plugin-diff-highlight-maintainers \ No newline at end of file diff --git a/.github/workflows/code-npm_node-publish-release-and-snapshot.yml b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml index b05180e..0806821 100644 --- a/.github/workflows/code-npm_node-publish-release-and-snapshot.yml +++ b/.github/workflows/code-npm_node-publish-release-and-snapshot.yml @@ -279,7 +279,6 @@ jobs: pull-requests: write if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true - && vars.NPM_PUBLISH_AUTOMATION_ENABLED == 'true' && !contains(join(github.event.pull_request.labels.*.name, ', '), 'skip-release') && (contains(join(github.event.pull_request.labels.*.name, ', '), 'release-type') || vars.DEVELOPMENT_FLOW == 'trunk-based-development' ))