Skip to content

Commit 23bac05

Browse files
fix: configure release-please with PAT and correct component mapping (#349)
- Fix component mismatch: add empty component to match existing v* tags - Update manifest version to 1.9.8 to match latest release tag - Use fine-grained PAT (RELEASE_PLEASE_TOKEN) for PR creation - SHA-pin release-please-action to v4.4.0 - Add FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 for Node.js 20 deprecation - Set least-privilege permissions at workflow level - Handle version strings with or without v prefix in getDriverVersion
1 parent 85bab12 commit 23bac05

4 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,26 @@ on:
66
- main
77
workflow_dispatch:
88

9-
permissions:
10-
contents: write
11-
pull-requests: write
9+
# Remove all default token permissions at the workflow level.
10+
# Individual jobs grant only the permissions they need.
11+
permissions: {}
1212

1313
jobs:
1414
release-please:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
env:
20+
# Opt in to Node.js 24 now. release-please-action v4.4.0 ships node20;
21+
# GitHub will force Node 24 on June 2 2026 and remove Node 20 on Sep 16 2026.
22+
# Remove this once the action publishes a node24-native version.
23+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1624
steps:
17-
- uses: googleapis/release-please-action@v4
25+
- name: Run Release Please
26+
# googleapis/release-please-action v4.4.0
27+
uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38
1828
with:
29+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
1930
config-file: release-please-config.json
2031
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.9.6"
2+
".": "1.9.8"
33
}

release-please-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
".": {
55
"release-type": "go",
66
"package-name": "go-mssqldb",
7+
"component": "",
8+
"include-component-in-tag": false,
79
"changelog-path": "CHANGELOG.md",
810
"bump-minor-pre-major": true,
911
"extra-files": [

version.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
package mssql
22

3-
import "fmt"
3+
import (
4+
"fmt"
5+
"strings"
6+
)
47

58
// This value is automatically updated by Release Please during the release process.
69
// It is written to the prelogin and login7 packets during a new connection.
7-
const driverVersion = "v1.9.8"
10+
const driverVersion = "v1.9.8" // x-release-please-version
811

912
func getDriverVersion(ver string) uint32 {
1013
var majorVersion uint32
1114
var minorVersion uint32
1215
var rev uint32
13-
_, _ = fmt.Sscanf(ver, "v%d.%d.%d", &majorVersion, &minorVersion, &rev)
16+
_, _ = fmt.Sscanf(strings.TrimPrefix(ver, "v"), "%d.%d.%d", &majorVersion, &minorVersion, &rev)
1417
return (majorVersion << 24) | (minorVersion << 16) | rev
1518
}

0 commit comments

Comments
 (0)