Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
28 changes: 6 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,18 @@ jobs:
name: NPM
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v6

- run: corepack enable

- uses: actions/setup-node@v6
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: npm
cache-dependency-path: typescript/package-lock.json

Expand All @@ -208,25 +212,5 @@ jobs:
working-directory: typescript

- run: npm run publish
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
working-directory: typescript
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

dependabot:
name: Dependabot
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Automatically approve dependabot PRs
uses: octokit/[email protected]
with:
route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
pull_number: ${{ github.event.pull_request.number }}
event: APPROVE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot

on:
pull_request:

jobs:
approve:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Approve Dependabot PR
uses: octokit/[email protected]
with:
route: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
pull_number: ${{ github.event.pull_request.number }}
event: APPROVE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Release
name: Post Release

on:
push:
tags: ["v*"]

jobs:
homebrew:
name: Bump Homebrew formula
name: Bump Homebrew Formula
runs-on: ubuntu-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v3
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion pkg/dbmate/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dbmate

// Version of dbmate
const Version = "2.29.0"
const Version = "2.29.1"
1 change: 1 addition & 0 deletions typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"packageManager": "[email protected]",
"scripts": {
"clean": "rimraf dist packages/dbmate/dist",
"lint": "eslint --report-unused-disable-directives --fix .",
Expand Down
4 changes: 3 additions & 1 deletion typescript/packages/dbmate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"schema",
"sqlite"
],
"bin": "./dist/cli.js",
"bin": {
"dbmate": "dist/cli.js"
},
"main": "./dist/index.js",
"files": [
"dist"
Expand Down
2 changes: 2 additions & 0 deletions typescript/packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "{{version}}",
"description": "The {{jsOS}} {{jsArch}} binary for dbmate",
"repository": "https://github.com/amacneil/dbmate",
"homepage": "https://github.com/amacneil/dbmate#readme",
"author": "Adrian Macneil",
"license": "MIT",
"preferUnplugged": true,
"os": [
Expand Down
13 changes: 12 additions & 1 deletion typescript/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ async function main() {
);

for (const pkg of packages) {
await exec("npm", ["publish", "--access", "public", pkg]);
// Unset NODE_AUTH_TOKEN to avoid conflicts with OIDC trusted publishing
delete process.env.NODE_AUTH_TOKEN;
await exec("corepack", ["npm", "--version"]);
Copy link

Choose a reason for hiding this comment

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

Debug version check runs redundantly inside publish loop

Low Severity

A debugging statement await exec("corepack", ["npm", "--version"]) was added inside the for loop that iterates over all packages. This causes the npm version to be printed once for every package being published, which is unnecessary and appears to be leftover debug code. If the version check was intentional for verification, it would only need to run once before the loop, not for each package iteration.

Fix in Cursor Fix in Web

await exec("corepack", [
"npm",
"publish",
"--dry-run",
"--provenance",
"--access",
"public",
pkg,
]);
}
}

Expand Down