-
Notifications
You must be signed in to change notification settings - Fork 3
CLOUDPLAT-3162: add npm OIDC publish workflow (s3scan) #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: NPM release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| npm-release: | ||
| uses: mapbox/gha-public/.github/workflows/workflow-npm-oidc-publish.yml@main | ||
|
Check warning on line 8 in .github/workflows/npm-release.yml
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also a few comments on the workflow itself to keep my feedback in one review:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general this workflow seems redundant as a whole. You have a 146-line boilerplate running typical workflow things like |
||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| with: | ||
| create-github-release: true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might make sense for private packages, but it's a questionable default for public projects, where it's important to have release notes written with care, not auto-generated from commits. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Contributing to s3scan | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| npm ci | ||
| npm test | ||
| ``` | ||
|
|
||
| ## Releasing a new version | ||
|
|
||
| Releases are published to npm via GitHub Actions. | ||
|
|
||
| ### Steps | ||
|
|
||
| 1. **Bump the version** in `package.json` (follow [semver](https://semver.org)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we want to follow common practices, a release should be 1) tagged, 2) marked with a clear semver commit. So |
||
| 2. **Update `CHANGELOG.md`** with a summary of what changed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no |
||
| 3. **Open a PR**, get it reviewed and merged to `master` | ||
| 4. **Trigger the release** from the [Actions tab](../../actions/workflows/npm-release.yml): | ||
| - Select **NPM release** → **Run workflow** → run from `master` | ||
|
|
||
| The workflow will publish to npm and create a GitHub release with auto-generated notes. | ||
|
|
||
| > **Note:** Only Mapbox maintainers with write access to this repository can trigger the release workflow. External contributors can open and contribute to PRs, but releases are always cut by the owning team. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This whole note feels redundant. Does it really need clarification that external PR authors can't publish NPM releases by themselves, and only package maintainers can actually do that? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@mapbox/s3scan", | ||
| "version": "3.0.0", | ||
| "version": "3.0.1", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is zero reason to bump versions in this PR template because changing the workflow does not change the package contents itself — instead of asking every receiver of these PRs to "remove the bump if you don't need it" (which is a lot of manual labor), it should have been the other way around (but I really can't think of any reason such a PR would need a version bump, except to test out the workflow immediately with a vain version). |
||
| "description": "Streaming operations on S3 objects", | ||
| "main": "index.js", | ||
| "engines": { | ||
|
|
@@ -39,5 +39,8 @@ | |
| "eslint": "^8.52.0", | ||
| "tape": "^4.6.3", | ||
| "underscore": "^1.13.6" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The workflow already passes the public tag ( |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ox-security is right — it's fragile to have this unpinned / not versioned; even an inconspicuous-looking update of the workflow can break releases across hundreds of repos.