Skip to content

Commit 2e15cc6

Browse files
authored
Merge pull request #11 from malbeclabs/chore/open-source-readiness
chore: prepare repo for open source (governance + CI controls)
2 parents f5ddab7 + 5393d3b commit 2e15cc6

24 files changed

Lines changed: 371 additions & 41 deletions

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Default owners for everything in the repo. Listed owners are requested for
2+
# review on every PR (enforced once branch protection requires CODEOWNERS review).
3+
* @juan-malbeclabs @ben-dz

.github/actionlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# actionlint config. The workflows here only run on the default GitHub-hosted
2+
# ubuntu-latest runner, so no self-hosted runner labels need declaring.
3+
self-hosted-runner:
4+
labels: []

.github/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Dependabot keeps Cargo crates and the SHA-pinned GitHub Actions up to date.
2+
# Mirrors the grouping style of malbeclabs/doublezero, trimmed to this single Rust
3+
# crate (no Go/Solana ecosystems here).
4+
version: 2
5+
updates:
6+
# Rust crates. Grouped so routine minor/patch bumps land in one PR, with the async
7+
# and serialization stacks split out (they tend to move together and need attention).
8+
- package-ecosystem: cargo
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
open-pull-requests-limit: 10
13+
groups:
14+
rust-minor-patch:
15+
update-types: [minor, patch]
16+
tokio:
17+
patterns: ["tokio*", "tokio-*", "futures-*"]
18+
serde:
19+
patterns: ["serde", "serde_*"]
20+
21+
# GitHub Actions are pinned to commit SHAs (see .github/workflows/*). Dependabot
22+
# bumps the SHA and the trailing version comment when a new release ships.
23+
- package-ecosystem: github-actions
24+
directory: "/"
25+
schedule:
26+
interval: weekly
27+
open-pull-requests-limit: 10
28+
groups:
29+
actions-minor-patch:
30+
update-types: [minor, patch]

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Summary of changes
2+
3+
<!-- What changed and why. Link any related issue or design doc. -->
4+
5+
- **What:**
6+
- **Why:**
7+
- **Protocol impact:** <!-- Any change to the WebSocket JSON in PROTOCOL.md? If so, how is forward-compat preserved? -->
8+
- **CHANGELOG.md update needed?** <!-- yes/no — if no, apply the `skip-changelog` label -->
9+
10+
## Testing
11+
12+
<!-- Evidence the change works: cargo test output, a manual run, a hexdump comparison, etc. -->

.github/workflows/actionlint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: actionlint
2+
3+
# Lints the GitHub Actions workflow YAML itself (syntax, expression typos, shellcheck
4+
# of inline run: scripts). Runs only when a workflow file or its config changes.
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- ".github/workflows/**"
10+
- ".github/actionlint.yaml"
11+
pull_request:
12+
paths:
13+
- ".github/workflows/**"
14+
- ".github/actionlint.yaml"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
actionlint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
24+
- uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12
25+
with:
26+
fail-on-error: true
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: changelog-reminder
2+
3+
# Nudges contributors to keep CHANGELOG.md current. Fails a PR that changes code but
4+
# leaves the changelog untouched, unless it carries the `skip-changelog` label.
5+
# Ported from malbeclabs/doublezero (.github/workflows/changelog-reminder.yml).
6+
on:
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled, unlabeled]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
changelog:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Require CHANGELOG.md update (or skip-changelog label)
22+
shell: bash
23+
env:
24+
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
25+
run: |
26+
set -euo pipefail
27+
if echo "$LABELS" | grep -q '"skip-changelog"'; then
28+
echo "skip-changelog label present — skipping changelog check."
29+
exit 0
30+
fi
31+
32+
base="${GITHUB_BASE_REF:-}"
33+
if [ -z "$base" ]; then
34+
base="$(git remote show origin | sed -n 's/.*HEAD branch: //p')"
35+
fi
36+
git fetch --quiet origin "$base"
37+
38+
changed="$(git diff --name-only "origin/${base}...HEAD")"
39+
echo "Changed files:"; echo "$changed"
40+
41+
if echo "$changed" | grep -qx 'CHANGELOG.md'; then
42+
echo "CHANGELOG.md updated. ✓"
43+
exit 0
44+
fi
45+
46+
echo "::error::CHANGELOG.md was not updated. Add an entry, or apply the 'skip-changelog' label if this change does not warrant one."
47+
exit 1

.github/workflows/release.docker.edge-connect.build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ on:
2929
default: ""
3030
type: string
3131

32+
# Reusable workflow: it runs under the caller job's permissions (publish/smoke/rebuild
33+
# set contents:read + packages:read/write). This default applies only to direct runs.
34+
permissions:
35+
contents: read
36+
3237
jobs:
3338
build:
3439
runs-on: ubuntu-latest
3540
steps:
36-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3742
with:
3843
ref: ${{ inputs.ref }}
3944

@@ -74,13 +79,13 @@ jobs:
7479
echo "latest=$latest"
7580
} >> "$GITHUB_OUTPUT"
7681
77-
- uses: docker/login-action@v3
82+
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
7883
with:
7984
registry: ghcr.io
8085
username: ${{ github.actor }}
8186
password: ${{ secrets.GITHUB_TOKEN }}
8287

83-
- uses: docker/setup-buildx-action@v3
88+
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
8489

8590
# Resolve the base to an immutable digest: reproducible builds + the digest
8691
# we record in the image label for the poll to compare against.
@@ -124,7 +129,7 @@ jobs:
124129
} >> "$GITHUB_OUTPUT"
125130
echo "Tags:"; printf '%s\n' "$tags"
126131
127-
- uses: docker/build-push-action@v6
132+
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
128133
with:
129134
context: .
130135
push: ${{ inputs.push }}

.github/workflows/release.docker.edge-connect.poll.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- cron: "23 5 * * *" # daily 05:23 UTC
1010
workflow_dispatch: {}
1111

12+
# Least-privilege default; the check/rebuild jobs set their own per-job permissions.
13+
permissions:
14+
contents: read
15+
1216
jobs:
1317
# Inspect all three bases; emit a JSON array of the variants whose base digest
1418
# no longer matches the digest baked into the published image.
@@ -20,13 +24,13 @@ jobs:
2024
outputs:
2125
stale: ${{ steps.scan.outputs.stale }}
2226
steps:
23-
- uses: docker/login-action@v3
27+
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
2428
with:
2529
registry: ghcr.io
2630
username: ${{ github.actor }}
2731
password: ${{ secrets.GITHUB_TOKEN }}
2832

29-
- uses: docker/setup-buildx-action@v3
33+
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
3034

3135
- id: scan
3236
shell: bash

.github/workflows/release.docker.edge-connect.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
- .github/workflows/release.docker.edge-connect.poll.yml
2020
workflow_dispatch: {}
2121

22+
# Least-privilege default; the publish/smoke jobs widen this per job as needed.
23+
permissions:
24+
contents: read
25+
2226
jobs:
2327
# Resolve the release version once: the vX.Y.Z tag with leading v stripped, or
2428
# empty for non-tag builds (which then publish moving tags only).

.github/workflows/release.install-script.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@ permissions:
2525

2626
env:
2727
AWS_REGION: us-east-1
28-
DEPLOY_ROLE: arn:aws:iam::879381273509:role/github-doublezero-install-deploy
2928
BUCKET: doublezero-install
30-
DISTRIBUTION_ID: E393SM6O109RQ3
29+
# Account-scoped infra (deploy-role ARN incl. the AWS account ID, and the CloudFront
30+
# distribution id) lives in repo Actions Variables so it is not baked into a public
31+
# workflow. Set both under Settings -> Secrets and variables -> Actions -> Variables:
32+
# DEPLOY_ROLE = arn:aws:iam::<account-id>:role/github-doublezero-install-deploy
33+
# DISTRIBUTION_ID = <cloudfront-distribution-id>
34+
DEPLOY_ROLE: ${{ vars.DEPLOY_ROLE }}
35+
DISTRIBUTION_ID: ${{ vars.DISTRIBUTION_ID }}
3136

3237
jobs:
3338
publish:
3439
runs-on: ubuntu-latest
3540
steps:
36-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
3742

38-
- uses: aws-actions/configure-aws-credentials@v4
43+
- uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
3944
with:
4045
role-to-assume: ${{ env.DEPLOY_ROLE }}
4146
aws-region: ${{ env.AWS_REGION }}

0 commit comments

Comments
 (0)