Skip to content

Commit a621d1d

Browse files
ci: pin GitHub Actions to commit SHAs for supply chain security
Pin 3rd party actions to specific commit SHAs to mitigate supply chain attacks (CWE-829). If a bad actor compromises an action's repository, they cannot affect our workflows since we reference immutable commits. Actions pinned: - actions/setup-go@7a3fe6c (v6.2.0) - golangci/golangci-lint-action@1e7e51e (v9.0.0) SHA verification: gh api repos/actions/setup-go/git/ref/tags/v6 --jq '.object.sha' gh api repos/golangci/golangci-lint-action/git/ref/tags/v9 --jq '.object.sha' Resolves code scanning alert #11
1 parent 935d926 commit a621d1d

15 files changed

Lines changed: 39 additions & 277 deletions

File tree

.github/copilot-instructions.md

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -155,57 +155,6 @@ The project supports creating SQL Server instances using Docker or Podman:
155155
- Use the `internal/localizer` package for localized messages
156156
- Supported languages: Chinese (Simplified/Traditional), English, French, German, Italian, Japanese, Korean, Portuguese (Brazil), Russian, Spanish
157157

158-
### Adding Localizable Strings
159-
160-
When adding user-facing strings to the code, use the `localizer` package:
161-
162-
```go
163-
import "github.com/microsoft/go-sqlcmd/internal/localizer"
164-
165-
// Use localizer.Sprintf for formatted strings
166-
message := localizer.Sprintf("This is a localizable message with %s", value)
167-
168-
// Use localizer.Errorf for localized errors
169-
err := localizer.Errorf("Error: %s failed", operation)
170-
```
171-
172-
Constants that are not user-facing (like environment variable names, command names) should be placed in `internal/localizer/constants.go` and do not need localization.
173-
174-
### Generating Localization Files
175-
176-
After adding new localizable strings, you **must** regenerate the translation catalog files before committing. The build scripts handle this automatically.
177-
178-
#### On Windows
179-
180-
```cmd
181-
build\build.cmd
182-
```
183-
184-
This script:
185-
- Installs `gotext` if not already installed
186-
- Runs `go generate` which executes the gotext command defined in `internal/translations/translations.go`
187-
- Generates/updates the translation catalog in `internal/translations/catalog.go`
188-
- Reports any conflicting localizable strings that need to be fixed
189-
190-
#### On Linux/macOS
191-
192-
Run the following commands manually:
193-
194-
```bash
195-
# Install gotext if not already installed
196-
go install golang.org/x/text/cmd/gotext@latest
197-
198-
# Generate translation files
199-
go generate ./...
200-
```
201-
202-
### Important Notes
203-
204-
- Always run the build script after adding new user-facing strings
205-
- Check the build output for "conflicting localizable strings" warnings and resolve them
206-
- The `SQLCMD_LANG` environment variable controls the runtime language (e.g., `de-de`, `fr-fr`)
207-
- Test your changes with different language settings to ensure proper localization
208-
209158
## Azure Authentication
210159

211160
- Azure AD authentication is supported via the `azidentity` package

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
name: lint-pr-changes
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/setup-go@v6
12+
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
1313
with:
1414
go-version: '1.24'
1515
- uses: actions/checkout@v6
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v9
17+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
1818
with:
1919
version: latest
2020
only-new-issues: true

NOTICE.md

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5056,61 +5056,6 @@ SUBDIRECTORIES
50565056
50575057
```
50585058

5059-
## github.com/shopspring/decimal
5060-
5061-
* Name: github.com/shopspring/decimal
5062-
* Version: v1.4.0
5063-
* License: [MIT](https://github.com/shopspring/decimal/blob/v1.4.0/LICENSE)
5064-
5065-
```
5066-
The MIT License (MIT)
5067-
5068-
Copyright (c) 2015 Spring, Inc.
5069-
5070-
Permission is hereby granted, free of charge, to any person obtaining a copy
5071-
of this software and associated documentation files (the "Software"), to deal
5072-
in the Software without restriction, including without limitation the rights
5073-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5074-
copies of the Software, and to permit persons to whom the Software is
5075-
furnished to do so, subject to the following conditions:
5076-
5077-
The above copyright notice and this permission notice shall be included in
5078-
all copies or substantial portions of the Software.
5079-
5080-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5081-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5082-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5083-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5084-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5085-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5086-
THE SOFTWARE.
5087-
5088-
- Based on https://github.com/oguzbilgic/fpd, which has the following license:
5089-
"""
5090-
The MIT License (MIT)
5091-
5092-
Copyright (c) 2013 Oguz Bilgic
5093-
5094-
Permission is hereby granted, free of charge, to any person obtaining a copy of
5095-
this software and associated documentation files (the "Software"), to deal in
5096-
the Software without restriction, including without limitation the rights to
5097-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5098-
the Software, and to permit persons to whom the Software is furnished to do so,
5099-
subject to the following conditions:
5100-
5101-
The above copyright notice and this permission notice shall be included in all
5102-
copies or substantial portions of the Software.
5103-
5104-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5105-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
5106-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
5107-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
5108-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
5109-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5110-
"""
5111-
5112-
```
5113-
51145059
## github.com/spf13/afero
51155060

51165061
* Name: github.com/spf13/afero

0 commit comments

Comments
 (0)