Skip to content

Commit 8b4d4c3

Browse files
ci: consolidate release pipeline and add PR security gate (#303)
* ci: consolidate release pipeline into `release.yml`, add PR security gate * build: exclude `ci/chore/build` commits from goreleaser changelog * fix: harden config dir perms to and annotate gosec false positives * ci: scope release workflow permissions to least privilege * build: silence hadolint DL3018 on throwaway apk build deps * docs: fix dead connectors link * ci: updating action version
1 parent 5c21099 commit 8b4d4c3

12 files changed

Lines changed: 682 additions & 656 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 642 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 624 additions & 4 deletions
Large diffs are not rendered by default.

.github/workflows/security.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Security
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
gosec:
12+
runs-on: ubuntu-22.04
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v6
17+
18+
- name: Run Gosec Security Scanner
19+
uses: securego/gosec@v2.25.0
20+
with:
21+
args: '-severity medium -confidence medium ./...'
22+
23+
bandit:
24+
runs-on: ubuntu-22.04
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version: '3.12'
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v7
37+
38+
- name: Run Bandit Security Scanner
39+
run: |
40+
uv tool run --from 'bandit[toml]' bandit \
41+
-r data_platform/pipelines \
42+
--severity-level medium \
43+
--confidence-level medium

.goreleaser.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ changelog:
6060
exclude:
6161
- "^docs:"
6262
- "^test:"
63+
- "^ci:"
64+
- "^chore:"
65+
- "^build:"
6366

6467
homebrew_casks:
6568
- name: poke-cli

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ FROM rust:1-alpine AS rust-build
1515

1616
WORKDIR /build
1717

18+
# hadolint ignore=DL3018
1819
RUN apk add --no-cache build-base
1920

2021
COPY services/Cargo.toml services/Cargo.lock ./services/
@@ -26,6 +27,7 @@ RUN cargo build --release --manifest-path services/Cargo.toml --bin poke-cache
2627
FROM alpine:3.24
2728

2829
# Installing only necessary packages and remove them after use
30+
# hadolint ignore=DL3018
2931
RUN apk add --no-cache shadow && \
3032
addgroup -S poke_group && adduser -S poke_user -G poke_group && \
3133
sed -i 's/^root:.*/root:!*:0:0:root:\/root:\/sbin\/nologin/' /etc/passwd && \

cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func runCLI(args []string) int {
214214
var exit = os.Exit
215215

216216
func isInteractive() bool {
217-
return term.IsTerminal(int(os.Stdin.Fd())) && term.IsTerminal(int(os.Stdout.Fd()))
217+
return term.IsTerminal(int(os.Stdin.Fd())) && term.IsTerminal(int(os.Stdout.Fd())) // #nosec G115
218218
}
219219

220220
func saveConfig(cfg flags.Config) {

cmd/types/damage_table.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func DamageTable(typesName string, endpoint string) (string, error) {
4040
out.WriteString(styling.StyleBold.Render("Damage Chart:"))
4141
out.WriteString("\n")
4242

43-
physicalWidth, _, _ := term.GetSize(uintptr(int(os.Stdout.Fd())))
43+
physicalWidth, _, _ := term.GetSize(uintptr(int(os.Stdout.Fd()))) // #nosec G115
4444
doc := strings.Builder{}
4545

4646
// Helper function to build list items

cmd/utils/web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ func Open(url string) tea.Cmd {
2222
switch runtime.GOOS {
2323
case "windows":
2424
browserCmd = "cmd"
25-
openCmd = exec.Command("cmd", "/c", "start", url) //nolint:gosec
25+
openCmd = exec.Command("cmd", "/c", "start", url) // #nosec G204
2626
case "darwin":
2727
browserCmd = "open"
28-
openCmd = exec.Command("open", url)
28+
openCmd = exec.Command("open", url) // #nosec G204
2929
default:
3030
browserCmd = "xdg-open"
31-
openCmd = exec.Command("xdg-open", url)
31+
openCmd = exec.Command("xdg-open", url) // #nosec G204
3232
}
3333

3434
if _, err := exec.LookPath(browserCmd); err != nil {

connections/cache.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func cachedFetch(url string) ([]byte, error) {
7171
warnNoCache()
7272
return directFetch(url)
7373
}
74-
out, err := exec.Command(path, "get", url).Output()
74+
out, err := exec.Command(path, "get", url).Output() // #nosec G204
7575
if err != nil {
7676
return directFetch(url)
7777
}

docs/Infrastructure_Guide/local-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ The above `yml` defines the structure for the raw `series` table from the `stagi
196196
Soda and its components needed for the project can be installed with `uv`:
197197
198198
1. Install Soda Core with PostgreSQL connector since Supabase uses PostgreSQL.
199-
Other [connectors](https://github.com/sodadata/soda-core/blob/main/docs/installation.md#compatibility) can be used.
199+
Other [connectors](https://github.com/sodadata/soda-core/blob/v3/docs/installation.md#compatibility) can be used.
200200
```shell
201201
uv add soda-core-postgres
202202
```

0 commit comments

Comments
 (0)