From ebc39cbee3a4c772d57fb59b28a977c7620dfc2a Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 10:34:58 +0200 Subject: [PATCH 1/7] ci(prerelease): skip npm publish without token --- .github/workflows/reusable-prerelease.yml | 43 +++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/reusable-prerelease.yml b/.github/workflows/reusable-prerelease.yml index 3113727..c902ef3 100644 --- a/.github/workflows/reusable-prerelease.yml +++ b/.github/workflows/reusable-prerelease.yml @@ -5,11 +5,11 @@ # Handles both VS Code extension (VSIX) and npm library (tarball) projects. # # Secret resolution (handled by GitHub automatically): -# 1. Repository-level secret (user-defined per repo — highest priority) +# 1. Repository-level secret (user-defined per repo — highest priority) # 2. Organization-level secret (shared fallback for the whole org) -# Callers just use `secrets: inherit` — GitHub resolves the priority. +# Callers just use `secrets: inherit` — GitHub resolves the priority. # -# Usage (VS Code extension — caller: pre-release.yml or pre-release-develop.yml): +# Usage (VS Code extension — caller: pre-release.yml or pre-release-develop.yml): # jobs: # pre-release: # uses: winccoa-tools-pack/.github/.github/workflows/reusable-prerelease.yml@main @@ -72,9 +72,9 @@ concurrency: cancel-in-progress: false jobs: - # ──────────────────────────────────────────── - # Versioning (shared — delegates to existing reusable) - # ──────────────────────────────────────────── + # ──────────────────────────────────────────── + # Versioning (shared — delegates to existing reusable) + # ──────────────────────────────────────────── versioning: uses: winccoa-tools-pack/.github/.github/workflows/versioning-tags-changelog-reusable.yml@main with: @@ -85,9 +85,9 @@ jobs: force_push_tag: true secrets: inherit - # ──────────────────────────────────────────── + # ──────────────────────────────────────────── # Build & publish prerelease - # ──────────────────────────────────────────── + # ──────────────────────────────────────────── prerelease: runs-on: ubuntu-latest needs: [versioning] @@ -114,7 +114,7 @@ jobs: - name: Install dependencies run: npm ci - # ── VS Code: install vsce ── + # ── VS Code: install vsce ── - name: Install vsce if: ${{ inputs.project_type == 'vscode' }} run: npm install -g @vscode/vsce @@ -128,13 +128,13 @@ jobs: echo "tag=$TAG" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT" - # ── npm: update package.json version ── + # ── npm: update package.json version ── - name: Set package.json version if: ${{ inputs.project_type == 'npm' }} shell: bash run: npm pkg set version="${{ steps.meta.outputs.version }}" - # ── Release body ── + # ── Release body ── - name: Build release body (vscode) if: ${{ inputs.project_type == 'vscode' }} id: body-vscode @@ -144,7 +144,7 @@ jobs: echo "body<> "$GITHUB_OUTPUT" - # ── VS Code: package VSIX ── + # ── VS Code: package VSIX ── - name: Package extension (VSIX) if: ${{ inputs.project_type == 'vscode' }} run: vsce package - # ── npm: build & pack tarball ── + # ── npm: build & pack tarball ── - name: Build package if: ${{ inputs.project_type == 'npm' }} run: npm run build @@ -185,12 +185,17 @@ jobs: run: npm pack - name: "Publish to npm (dist-tag: next)" - if: ${{ inputs.project_type == 'npm' && inputs.publish_to_npm && github.repository_owner == 'winccoa-tools-pack' }} + if: ${{ inputs.project_type == 'npm' && inputs.publish_to_npm && github.repository_owner == 'winccoa-tools-pack' && secrets.NPM_TOKEN != '' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: npm publish --tag next --access public --ignore-scripts - # ── Upload artifact ── + - name: "Skip npm publish (no token available)" + if: ${{ inputs.project_type == 'npm' && inputs.publish_to_npm && github.repository_owner == 'winccoa-tools-pack' && secrets.NPM_TOKEN == '' }} + run: | + echo "Skipping npm publish: NPM_TOKEN is not available in this workflow run (e.g. Dependabot PR)." + + # ── Upload artifact ── - name: Upload VSIX artifact if: ${{ inputs.project_type == 'vscode' }} uses: actions/upload-artifact@v6 @@ -207,12 +212,12 @@ jobs: path: "*.tgz" retention-days: 14 - # ── GitHub prerelease ── + # ── GitHub prerelease ── - name: Create GitHub prerelease uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.meta.outputs.tag }} - name: ${{ format('🧪 Pre-Release {0}', steps.meta.outputs.tag) }} + name: ${{ format('🧪 Pre-Release {0}', steps.meta.outputs.tag) }} target_commitish: ${{ inputs.target_branch != '' && inputs.target_branch || github.sha }} body: ${{ inputs.project_type == 'vscode' && steps.body-vscode.outputs.body || steps.body-npm.outputs.body }} files: ${{ inputs.project_type == 'vscode' && '*.vsix' || '*.tgz' }} From e0d4ce802b1cc4df28841314c420fd1b66fc27dd Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 21:51:03 +0200 Subject: [PATCH 2/7] chore(ci): remove emojis to avoid mojibake --- .github/workflows/reusable-prerelease.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-prerelease.yml b/.github/workflows/reusable-prerelease.yml index c902ef3..0c1120f 100644 --- a/.github/workflows/reusable-prerelease.yml +++ b/.github/workflows/reusable-prerelease.yml @@ -144,7 +144,7 @@ jobs: echo "body< Date: Fri, 8 May 2026 21:51:57 +0200 Subject: [PATCH 3/7] chore(ci): remove emojis to avoid mojibake From d1063b2c58a55c5f8e1a5ba2dc7e616ab4cda9ad Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 22:13:25 +0200 Subject: [PATCH 4/7] chore(ci): replace box-drawing separators with ASCII --- .github/workflows/reusable-prerelease.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reusable-prerelease.yml b/.github/workflows/reusable-prerelease.yml index 0c1120f..f96b712 100644 --- a/.github/workflows/reusable-prerelease.yml +++ b/.github/workflows/reusable-prerelease.yml @@ -72,9 +72,9 @@ concurrency: cancel-in-progress: false jobs: - # ──────────────────────────────────────────── - # Versioning (shared — delegates to existing reusable) - # ──────────────────────────────────────────── + # -------------------------------------------- + # Versioning (shared - delegates to existing reusable) + # -------------------------------------------- versioning: uses: winccoa-tools-pack/.github/.github/workflows/versioning-tags-changelog-reusable.yml@main with: @@ -85,9 +85,9 @@ jobs: force_push_tag: true secrets: inherit - # ──────────────────────────────────────────── + # -------------------------------------------- # Build & publish prerelease - # ──────────────────────────────────────────── + # -------------------------------------------- prerelease: runs-on: ubuntu-latest needs: [versioning] From f3cb2dc13cc229c88a3a6e36dff115421f48a96c Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 22:17:50 +0200 Subject: [PATCH 5/7] chore(ci): replace inline box-drawing markers with ASCII --- .github/workflows/reusable-prerelease.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-prerelease.yml b/.github/workflows/reusable-prerelease.yml index f96b712..1d1c173 100644 --- a/.github/workflows/reusable-prerelease.yml +++ b/.github/workflows/reusable-prerelease.yml @@ -114,7 +114,7 @@ jobs: - name: Install dependencies run: npm ci - # ── VS Code: install vsce ── + # -- VS Code: install vsce -- - name: Install vsce if: ${{ inputs.project_type == 'vscode' }} run: npm install -g @vscode/vsce @@ -128,13 +128,13 @@ jobs: echo "tag=$TAG" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT" - # ── npm: update package.json version ── + # -- npm: update package.json version -- - name: Set package.json version if: ${{ inputs.project_type == 'npm' }} shell: bash run: npm pkg set version="${{ steps.meta.outputs.version }}" - # ── Release body ── + # -- Release body -- - name: Build release body (vscode) if: ${{ inputs.project_type == 'vscode' }} id: body-vscode @@ -170,12 +170,12 @@ jobs: echo "EOF" } >> "$GITHUB_OUTPUT" - # ── VS Code: package VSIX ── + # -- VS Code: package VSIX -- - name: Package extension (VSIX) if: ${{ inputs.project_type == 'vscode' }} run: vsce package - # ── npm: build & pack tarball ── + # -- npm: build & pack tarball -- - name: Build package if: ${{ inputs.project_type == 'npm' }} run: npm run build @@ -195,7 +195,7 @@ jobs: run: | echo "Skipping npm publish: NPM_TOKEN is not available in this workflow run (e.g. Dependabot PR)." - # ── Upload artifact ── + # -- Upload artifact -- - name: Upload VSIX artifact if: ${{ inputs.project_type == 'vscode' }} uses: actions/upload-artifact@v6 @@ -212,7 +212,7 @@ jobs: path: "*.tgz" retention-days: 14 - # ── GitHub prerelease ── + # -- GitHub prerelease -- - name: Create GitHub prerelease uses: softprops/action-gh-release@v2 with: From 0391dd19195a619cba9914539f0d43963b0a1060 Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 22:30:17 +0200 Subject: [PATCH 6/7] chore(ci): replace em dashes with ASCII --- .github/workflows/reusable-prerelease.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-prerelease.yml b/.github/workflows/reusable-prerelease.yml index 1d1c173..9f68287 100644 --- a/.github/workflows/reusable-prerelease.yml +++ b/.github/workflows/reusable-prerelease.yml @@ -5,11 +5,11 @@ # Handles both VS Code extension (VSIX) and npm library (tarball) projects. # # Secret resolution (handled by GitHub automatically): -# 1. Repository-level secret (user-defined per repo — highest priority) +# 1. Repository-level secret (user-defined per repo - highest priority) # 2. Organization-level secret (shared fallback for the whole org) -# Callers just use `secrets: inherit` — GitHub resolves the priority. +# Callers just use `secrets: inherit` - GitHub resolves the priority. # -# Usage (VS Code extension — caller: pre-release.yml or pre-release-develop.yml): +# Usage (VS Code extension - caller: pre-release.yml or pre-release-develop.yml): # jobs: # pre-release: # uses: winccoa-tools-pack/.github/.github/workflows/reusable-prerelease.yml@main From ecb29468e351d061284b7c56c77091db9125fbf5 Mon Sep 17 00:00:00 2001 From: Martin Pokorny <89339813+mPokornyETM@users.noreply.github.com> Date: Fri, 8 May 2026 22:36:31 +0200 Subject: [PATCH 7/7] ci: add PR Labels required check workflow --- .github/workflows/pr-labels.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-labels.yml diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml new file mode 100644 index 0000000..719b565 --- /dev/null +++ b/.github/workflows/pr-labels.yml @@ -0,0 +1,19 @@ +name: PR Labels + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + workflow_dispatch: + +permissions: + contents: read + pull-requests: read + +jobs: + required: + name: PR Labels - Required + runs-on: ubuntu-latest + steps: + - name: Report required check + run: | + echo "PR Labels check reported."