Repository navigation
chore: repository hygiene and CI skeleton #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3b59d79
docs: add security policy
omercnet 044444d
docs: add contributing guide and pull request template
omercnet 4817b6f
chore: add editorconfig and gitignore
omercnet 4a70d8c
chore: add CODEOWNERS
omercnet 9360e66
chore: add gitleaks configuration
omercnet 6af6f36
chore: configure Renovate
omercnet 38e17d7
ci: add CI skeleton with secret scan, workflow lint and required gate
omercnet 19e68c7
fix(renovate): match v-prefixed 0.x versions in manual-minor rule
omercnet c667bc8
ci: let Renovate track the zizmor version
omercnet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_style = space | ||
| indent_size = 2 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Default owner for everything. | ||
| * @omercnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ## What changed | ||
|
|
||
| ## Why | ||
|
|
||
| ## How it was verified | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Tests added or updated, or not applicable | ||
| - [ ] No secrets or credentials committed | ||
| - [ ] Docs updated, or not applicable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # RunsOn label convention for heavy jobs that arrive with the code (not used | ||
| # yet: every job below is a tiny gate job on ubuntu-latest): | ||
| # runs-on: runs-on=${{ github.run_id }}-${{ github.run_attempt }}-<job>/runner=4cpu-linux-x64 | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| # Key PR runs by number so they cannot cancel the push run for a merged commit. | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| gitleaks: | ||
| name: Secret Scan | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - name: Install gitleaks | ||
| env: | ||
| # renovate: datasource=github-releases depName=gitleaks/gitleaks | ||
| GITLEAKS_VERSION: 8.30.1 | ||
| GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb | ||
| run: | | ||
| curl -fsSLo gitleaks.tar.gz "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | ||
| echo "${GITLEAKS_SHA256} gitleaks.tar.gz" | sha256sum -c - | ||
| tar -xzf gitleaks.tar.gz gitleaks && rm gitleaks.tar.gz | ||
| - name: Scan commits | ||
| run: ./gitleaks git --config .gitleaks.toml --redact --verbose . | ||
| - name: Scan tree | ||
| run: ./gitleaks dir --config .gitleaks.toml --redact --verbose . | ||
|
|
||
| workflow-policy: | ||
| name: Workflow Policy | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Run actionlint | ||
| env: | ||
| # renovate: datasource=github-releases depName=rhysd/actionlint | ||
| ACTIONLINT_VERSION: 1.7.12 | ||
| ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 | ||
| run: | | ||
| curl -fsSLo actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | ||
| echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c - | ||
| tar -xzf actionlint.tar.gz actionlint && rm actionlint.tar.gz | ||
| ./actionlint | ||
| - name: Run zizmor | ||
| uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1 | ||
| with: | ||
| advanced-security: false | ||
| annotations: true | ||
| version: 1.30.1 | ||
|
|
||
| ci-required: | ||
| name: CI Required | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| if: always() | ||
| needs: | ||
| - gitleaks | ||
| - workflow-policy | ||
| steps: | ||
| - name: Verify every needed job succeeded | ||
| env: | ||
| NEEDS_JSON: ${{ toJSON(needs) }} | ||
| run: | | ||
| set -eu | ||
| # Strict success-only semantics: a skipped or failed job fails the gate. | ||
| jq -r 'to_entries[] | if .value.result == "success" then "OK \(.key)" else "FAIL \(.key) (result=\(.value.result))" end' <<< "$NEEDS_JSON" | ||
| if jq -e '[ to_entries[] | select(.value.result != "success") ] | length > 0' <<< "$NEEDS_JSON" >/dev/null; then | ||
| echo "" | ||
| echo "::error::One or more required jobs did not succeed. CI gate failing." | ||
| exit 1 | ||
| fi | ||
| echo "" | ||
| echo "All required jobs succeeded. CI gate passes." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| node_modules/ | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
| dist/ | ||
| coverage/ | ||
| .vitest/ | ||
| test-results/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Gitleaks config. Extends the default rules. Nothing is allow-listed yet: | ||
| # each pull request that adds credential-shaped test fixtures allow-lists only | ||
| # what it needs here, with a comment explaining why. | ||
| title = "grimoire gitleaks" | ||
|
|
||
| [extend] | ||
| useDefault = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Contributing | ||
|
|
||
| Grimoire is developed in the open, through small pull requests into `main`. | ||
|
|
||
| - Keep each pull request focused on one change. | ||
| - Use [Conventional Commits](https://www.conventionalcommits.org/) for commit | ||
| and pull request titles (for example `feat: add page export`). Pull requests | ||
| are squash-merged, so the title becomes the commit message on `main`. | ||
| - Every change needs passing CI (the `CI Required` check) and one approval, | ||
| and all review threads must be resolved. | ||
| - Pull requests from outside the project are welcome, but reviews may take a | ||
| while. | ||
| - Never commit secrets or credentials. | ||
|
|
||
| To report a security issue, do not open a public issue: follow | ||
| [SECURITY.md](SECURITY.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Security policy | ||
|
|
||
| ## Status | ||
|
|
||
| Grimoire is in active development. It has not been deployed, released, or | ||
| audited. There are no supported versions yet; once releases exist, this file | ||
| will say which ones receive security fixes. | ||
|
|
||
| ## Reporting a vulnerability | ||
|
|
||
| Report security issues privately with GitHub private vulnerability reporting: | ||
| open the **Security** tab of this repository and choose **Report a | ||
| vulnerability**. Please do not open a public issue or pull request before the | ||
| maintainers have had a reasonable opportunity to investigate. | ||
|
|
||
| Include a description of the problem, steps to reproduce it, and the commit you | ||
| tested. | ||
|
|
||
| ## Scope | ||
|
|
||
| In scope: | ||
|
|
||
| - vulnerabilities in code or configuration in this repository; | ||
| - weaknesses in the CI workflows or other supply-chain tooling; | ||
| - secrets or credentials committed to the repository. | ||
|
|
||
| Out of scope: | ||
|
|
||
| - vulnerabilities in third-party dependencies with no effect on this project; | ||
| - issues that require an already compromised machine or account; | ||
| - general support requests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| "$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
| "extends": [ | ||
| "config:recommended", | ||
| "helpers:pinGitHubActionDigests" | ||
| ], | ||
| "schedule": [ | ||
| "at any time" | ||
| ], | ||
| "prConcurrentLimit": 5, | ||
| "automerge": true, | ||
| "automergeType": "pr", | ||
| "automergeStrategy": "squash", | ||
| "platformAutomerge": true, | ||
| "lockFileMaintenance": { | ||
| "enabled": true, | ||
| "schedule": [ | ||
| "before 4am on monday" | ||
| ], | ||
| "automerge": false | ||
| }, | ||
| "packageRules": [ | ||
| { | ||
| "description": "0.x minor bumps can be breaking; keep manual", | ||
| "matchCurrentVersion": "/^0\\./", | ||
|
omercnet marked this conversation as resolved.
Resolved
|
||
| "matchUpdateTypes": [ | ||
| "minor" | ||
| ], | ||
| "automerge": false | ||
| }, | ||
| { | ||
| "description": "Major updates stay manual", | ||
| "matchUpdateTypes": [ | ||
| "major" | ||
| ], | ||
| "automerge": false | ||
| }, | ||
| { | ||
| "description": "Pinned tool binaries carry a sha256 that must be bumped by hand in the same PR", | ||
| "matchDepNames": [ | ||
| "gitleaks/gitleaks", | ||
| "rhysd/actionlint" | ||
| ], | ||
| "automerge": false | ||
| } | ||
| ], | ||
| "minimumReleaseAge": "3 days", | ||
| "internalChecksFilter": "strict", | ||
| "customManagers": [ | ||
| { | ||
| "customType": "regex", | ||
| "description": "Version pins in workflow step env vars, e.g. the gitleaks binary (sha256 must be bumped in the same PR; the checksum step fails otherwise)", | ||
| "managerFilePatterns": ["/^\\.github/workflows/.+\\.ya?ml$/"], | ||
| "matchStrings": [ | ||
| "# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+\\w+_VERSION: (?<currentValue>\\S+)" | ||
| ], | ||
| "extractVersionTemplate": "^v?(?<version>.*)$" | ||
| } | ||
| ], | ||
| "github-actions": { | ||
| "pinDigests": true | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.