Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 17 additions & 42 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
name: Bump, Release, and Publish
name: Publish to NPM

on:
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow is no longer reusable: switching the trigger from workflow_call to push means downstream repos (and this repo’s own workflow-templates/npm-publish.yml) can’t uses: prosegrinder/.github/.github/workflows/npm-publish.yaml@... anymore. If the intent is to keep a reusable publish workflow, restore on: workflow_call (with the required secrets/inputs) and put the tag-triggered “starter” workflow in workflow-templates/ instead (or publish both entrypoints).

Suggested change
on:
on:
workflow_call:

Copilot uses AI. Check for mistakes.
workflow_call:
inputs:
newversion:
description: "Bump Type (major minor patch)"
default: "patch"
required: true
type: string
secrets:
VERSION_BUMP_TAG_TOKEN:
required: true
NPM_ACCESS_TOKEN:
required: true
push:
tags:
- "v*"

# Note: Use this for your workflow
# on:
# workflow_dispatch:
# inputs:
# newversion:
# description: "Bump Type (major minor patch)"
# required: true
# default: "patch"
# type: choice
# options:
# - patch
# - minor
# - major
permissions:
id-token: write
contents: read
Comment on lines +8 to +10
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permissions: id-token: write is granted workflow-wide, including the lint/test reusable jobs that don’t need OIDC. To follow least-privilege, move id-token: write to the publish job only (keep minimal read permissions at the workflow level if needed).

Copilot uses AI. Check for mistakes.

# concurrency:
# group: tag-and-release
# cancel-in-progress: true
concurrency:
group: npm-publish-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
Expand All @@ -40,30 +21,24 @@ jobs:
needs: lint
uses: prosegrinder/.github/.github/workflows/npm-test.yaml@main

build-publish-tag-release:
publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
uses: "actions/checkout@v6"
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6.2.0
uses: actions/setup-node@v6
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes actions/setup-node from the previously pinned @v6.2.0 used elsewhere in this repo to the floating major @v6. For reproducibility (and to match the existing convention in other workflows here), pin this to a specific version (or ideally a commit SHA).

Suggested change
uses: actions/setup-node@v6
uses: actions/setup-node@v6.2.0

Copilot uses AI. Check for mistakes.
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- name: NPM Clean Install
run: npm ci
- name: NPM Run Build
run: npm run build --if-present
- name: Bump, Release, and Publish
uses: bcomnes/npm-bump@v2
with:
git_email: david@davidlday.com
git_username: ${{ github.actor }}
newversion: ${{ inputs.newversion }}
push_version_commit: true
github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }}
npm_token: ${{secrets.NPM_ACCESS_TOKEN}}
- name: NPM Publish Dry Run
run: npm publish --dry-run
- name: NPM Publish
run: npm publish
18 changes: 18 additions & 0 deletions .github/workflows/npm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Bump Version and Create Release

on:
push:
branches:
- main
Comment on lines +4 to +6
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is added under .github/workflows/ but is a repo-executed workflow (on: push) rather than a reusable workflow (on: workflow_call), unlike the other workflows in this directory. If this is intended as a starter workflow for consumers, it should live under workflow-templates/; if it’s intended to be reusable, switch it to workflow_call and provide a corresponding starter template that invokes it.

Suggested change
push:
branches:
- main
workflow_call:
secrets:
VERSION_BUMP_TAG_TOKEN:
required: true

Copilot uses AI. Check for mistakes.

concurrency:
group: tag-and-release-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
# Don't run 'bump:'
uses: prosegrinder/.github/.github/workflows/cz-bump-release.yaml@main
secrets:
VERSION_BUMP_TAG_TOKEN: "${{ secrets.VERSION_BUMP_TAG_TOKEN }}"
Loading