Skip to content

Add automated npm publish workflow#160

Open
GoogilyBoogily wants to merge 1 commit intomainfrom
add-publish-workflow
Open

Add automated npm publish workflow#160
GoogilyBoogily wants to merge 1 commit intomainfrom
add-publish-workflow

Conversation

@GoogilyBoogily
Copy link
Copy Markdown
Contributor

Summary

  • Adds a workflow_dispatch-triggered publish workflow that uses the shared reusable workflow from braintree/web-sdk-github-actions
  • Pipeline: CI (lint + test) → version bump → npm publish (with provenance) → GitHub release notes
  • Triggered manually with version type selection (patch, minor, major)
  • Adds ## UNRELEASED section to CHANGELOG.md (required by the version-bump action)

How it works

The thin publish.yml calls the shared braintree/web-sdk-github-actions/.github/workflows/publish.yml workflow, which orchestrates:

  1. CI — runs existing lint and test suite; publish is blocked if tests fail
  2. Version bumpnpm version, updates CHANGELOG (UNRELEASED → version + date), commits, tags, pushes
  3. npm publishnpm publish --provenance using org-level BRAINTREE_NPM_ACCESS_TOKEN
  4. Release notes — auto-generates GitHub release from tag + changelog

Test plan

  • Verify "Publish to npm" workflow appears in Actions tab after merge
  • Confirm workflow_dispatch trigger shows version_type dropdown (patch/minor/major)
  • Validate end-to-end on next planned release

Uses the shared reusable publish workflow from
braintree/web-sdk-github-actions to automate the release process:
CI → version bump → npm publish (with provenance) → GitHub release.

Adds UNRELEASED section to CHANGELOG.md for the version-bump action.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 16:08
@GoogilyBoogily GoogilyBoogily requested a review from a team as a code owner April 21, 2026 16:08
@github-actions
Copy link
Copy Markdown

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
See the Details below.

Scanned Files

  • .github/workflows/publish.yml

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a manually triggered GitHub Actions workflow to publish this package to npm using a shared reusable workflow, and updates the changelog to support the version-bump step.

Changes:

  • Added ## UNRELEASED section to CHANGELOG.md for automated version bumping.
  • Introduced .github/workflows/publish.yml to run a workflow_dispatch-triggered publish pipeline via braintree/web-sdk-github-actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
CHANGELOG.md Adds an UNRELEASED section required by the version-bump automation.
.github/workflows/publish.yml Adds a manual “Publish to npm” workflow that delegates to the shared publish reusable workflow and passes npm credentials/permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


jobs:
publish:
uses: braintree/web-sdk-github-actions/.github/workflows/publish.yml@main
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

The reusable workflow is referenced via @main, which makes releases non-reproducible and introduces supply-chain risk (the behavior can change without changes in this repo). Consider pinning to an immutable ref (a commit SHA or a version tag) similar to .github/workflows/ci.yml:17.

Suggested change
uses: braintree/web-sdk-github-actions/.github/workflows/publish.yml@main
uses: braintree/web-sdk-github-actions/.github/workflows/publish.yml@v1

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants