From 1751d6d01a8e34ac6d8f3b0d2115ddaa46fe8fb2 Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 09:57:27 +0100 Subject: [PATCH 1/6] upgrade to go1.22 Signed-off-by: cpanato --- .gitignore | 2 ++ go.mod | 13 +++++++++---- go.sum | 26 ++++++++++++++++++-------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 194e731..3664be5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ ./mdtoc coverage* +dist/ +output/ diff --git a/go.mod b/go.mod index 9114069..1f169ea 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,21 @@ module sigs.k8s.io/mdtoc -go 1.21 +go 1.22 require ( github.com/gomarkdown/markdown v0.0.0-20220527210340-c82b80a9daf2 github.com/mmarkdown/mmark v2.0.40+incompatible - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.8.4 + sigs.k8s.io/release-utils v0.7.7 ) require ( github.com/BurntSushi/toml v0.3.1 // indirect - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e26e8b5..44d2906 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,28 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ= +github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gomarkdown/markdown v0.0.0-20220527210340-c82b80a9daf2 h1:VJwys0mqRBeVxECc/DyXgveOqOqI81J9sjQFZHZwJvs= github.com/gomarkdown/markdown v0.0.0-20220527210340-c82b80a9daf2/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/mmarkdown/mmark v2.0.40+incompatible h1:vMeUeDzBK3H+/mU0oMVfMuhSXJlIA+DE/DMPQNAj5C4= github.com/mmarkdown/mmark v2.0.40+incompatible/go.mod h1:Uvmoz7tvsWpr7bMVxIpqZPyN3FbOtzDmnsJDFp7ltJs= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/release-utils v0.7.7 h1:JKDOvhCk6zW8ipEOkpTGDH/mW3TI+XqtPp16aaQ79FU= +sigs.k8s.io/release-utils v0.7.7/go.mod h1:iU7DGVNi3umZJ8q6aHyUFzsDUIaYwNnNKGHo3YE5E3s= From a235e38f0813d62d27fc95e6282c8e6c5184726c Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 09:57:47 +0100 Subject: [PATCH 2/6] add version flag option Signed-off-by: cpanato --- mdtoc.go | 14 ++++++++++++++ pkg/mdtoc/mdtoc.go | 1 + 2 files changed, 15 insertions(+) diff --git a/mdtoc.go b/mdtoc.go index a0736f2..ac949b1 100644 --- a/mdtoc.go +++ b/mdtoc.go @@ -23,6 +23,8 @@ import ( "log" "os" + "sigs.k8s.io/release-utils/version" + "sigs.k8s.io/mdtoc/pkg/mdtoc" ) @@ -38,6 +40,7 @@ func init() { flag.BoolVar(&defaultOptions.Inplace, "inplace", false, "Whether to edit the file in-place, or output to STDOUT. Requires toc tags to be present.") flag.BoolVar(&defaultOptions.SkipPrefix, "skip-prefix", true, "Whether to ignore any headers before the opening toc tag.") flag.IntVar(&defaultOptions.MaxDepth, "max-depth", mdtoc.MaxHeaderDepth, "Limit the depth of headers that will be included in the TOC.") + flag.BoolVar(&defaultOptions.Version, "version", false, "Show MDTOC version.") flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [OPTIONS] [FILE]...\n", os.Args[0]) @@ -49,6 +52,17 @@ func init() { func main() { flag.Parse() + + if defaultOptions.Version { + v := version.GetVersionInfo() + v.Name = "mdtoc" + v.Description = "is a utility for generating a table-of-contents for markdown files" + v.ASCIIName = "true" + v.FontName = "banner" + fmt.Fprintln(os.Stdout, v.String()) + os.Exit(0) + } + if err := validateArgs(defaultOptions, flag.Args()); err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) flag.Usage() diff --git a/pkg/mdtoc/mdtoc.go b/pkg/mdtoc/mdtoc.go index 0f340d9..ccf648a 100644 --- a/pkg/mdtoc/mdtoc.go +++ b/pkg/mdtoc/mdtoc.go @@ -49,6 +49,7 @@ var ( type Options struct { Dryrun bool SkipPrefix bool + Version bool MaxDepth int } From 0572c8fe11babe8adfc9775f8559624b59c1f747 Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 09:58:01 +0100 Subject: [PATCH 3/6] add dependabot config Signed-off-by: cpanato --- .github/dependabot.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2ac5ecc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +--- +version: 2 +updates: + - package-ecosystem: gomod + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + groups: + all: + update-types: + - "minor" + - "patch" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + groups: + all: + update-types: + - "minor" + - "patch" From a3a51254764db171257315ffb1562e901c3183e8 Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 09:58:19 +0100 Subject: [PATCH 4/6] add release job and configs Signed-off-by: cpanato --- .github/workflows/release.yml | 86 ++++++++++++++++++++++++++++++++++ .github/workflows/snapshot.yml | 31 ++++++++++++ .goreleaser.yml | 82 ++++++++++++++++++++++++++++++++ .mdtoc-bom-config.yaml | 43 +++++++++++++++++ Makefile | 40 ++++++++++++++++ 5 files changed, 282 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/snapshot.yml create mode 100644 .goreleaser.yml create mode 100644 .mdtoc-bom-config.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ebf9c28 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,86 @@ +name: Release + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + release: + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + env: + COSIGN_YES: "true" + + steps: + - name: Check out code onto GOPATH + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 1 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: './go.mod' + check-latest: true + + - name: Install cosign + uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0 + + - name: Install bom + uses: kubernetes-sigs/release-actions/setup-bom@10fecc1c66829d291b2f2fb1a27329d152f212e6 # v0.1.3 + + - name: Install GoReleaser + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + install-only: true + + - name: Get TAG + id: get_tag + run: echo "TAG=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" + + - name: Run Mage + uses: magefile/mage-action@6a5dcb5fe61f43d7c08a98bc3cf9bc63c308c08e # v3.0.0 + with: + version: latest + args: buildBinaries + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + attestation: + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + needs: + - release + + steps: + - name: Check out code onto GOPATH + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 1 + + - name: Set tag output + id: tag + run: echo "tag_name=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" + + - name: Install tejolote + uses: kubernetes-sigs/release-actions/setup-tejolote@10fecc1c66829d291b2f2fb1a27329d152f212e6 # v0.1.3 + + - run: | + tejolote attest --artifacts github://kubernetes-sigs/tejolote/${{ steps.tag.outputs.tag_name }} github://kubernetes-sigs/tejolote/"${GITHUB_RUN_ID}" --output tejolote.intoto.json --sign + + - name: Release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + with: + files: tejolote.intoto.json + tag_name: "${{ steps.tag.outputs.tag_name }}" + token: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_REPOSITORY: kubernetes-sigs/tejolote diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..bb61c82 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,31 @@ +name: Snapshot + +on: + push: + branches: + - 'master' + pull_request: + +jobs: + snapshot: + runs-on: ubuntu-latest + + steps: + - name: Check out code onto GOPATH + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + with: + go-version-file: './go.mod' + check-latest: true + + - name: Install bom + uses: kubernetes-sigs/release-actions/setup-bom@10fecc1c66829d291b2f2fb1a27329d152f212e6 # v0.1.3 + + - name: Install GoReleaser + uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + with: + install-only: true + + - name: check binary + run: ./dist/mdtoc-amd64-linux -version diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..2e3ea95 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,82 @@ +project_name: mdtoc + +env: + - CGO_ENABLED=0 + - COSIGN_YES=true + +before: + hooks: + - go mod tidy + # - /bin/bash -c 'if [ -n "$(git --no-pager diff --exit-code go.mod go.sum)" ]; then exit 1; fi' + +gomod: + proxy: true + +builds: + - id: mdtoc + dir: . + no_unique_dist_dir: true + binary: mdtoc-{{ .Arch }}-{{ .Os }} + goos: + - darwin + - linux + - windows + goarch: + - amd64 + - arm64 + - arm + goarm: + - '7' + ignore: + - goos: windows + goarch: arm + flags: + - -trimpath + ldflags: + - "{{ .Env.LDFLAGS }}" + +archives: + - format: binary + name_template: "{{ .Binary }}" + allow_different_binary_count: true + +signs: + # Keyless + - id: mdtoc-keyless + signature: "${artifact}.sig" + certificate: "${artifact}.pem" + cmd: cosign + args: ["sign-blob", "--output-signature", "${artifact}.sig", "--output-certificate", "${artifact}.pem", "${artifact}"] + artifacts: all + +sboms: + - id: mdtoc + cmd: bom + args: + - generate + - "--output" + - "mdtoc-bom.json.spdx" + - "-d" + - "../" + - "-c" + - "../.mdtoc-bom-config.yaml" + - "--format" + - "json" + artifacts: any + documents: + - "mdtoc-bom.json.spdx" + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ .Tag }}-next" + +release: + github: + owner: kubernetes-sigs + name: mdtoc + prerelease: auto + +changelog: + skip: true diff --git a/.mdtoc-bom-config.yaml b/.mdtoc-bom-config.yaml new file mode 100644 index 0000000..1dcf3a1 --- /dev/null +++ b/.mdtoc-bom-config.yaml @@ -0,0 +1,43 @@ +--- +namespace: https://sigs.k8s.io/zeitgeist +license: Apache-2.0 +name: mdtoc +creator: + person: The Kubernetes Authors + tool: mdtoc + +artifacts: + - type: file + source: mdtoc-amd64-windows.exe + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-arm64-windows.exe + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-amd64-darwin + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-amd64-linux + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-arm-linux + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-arm64-darwin + license: Apache-2.0 + gomodules: true + + - type: file + source: mdtoc-arm64-linux + license: Apache-2.0 + gomodules: true diff --git a/Makefile b/Makefile index 97dd203..22ba216 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,34 @@ SHELL:=/usr/bin/env bash COLOR:=\\033[36m NOCOLOR:=\\033[0m +# Set version variables for LDFLAGS +GIT_VERSION ?= $(shell git describe --tags --always --dirty) +GIT_HASH ?= $(shell git rev-parse HEAD) +DATE_FMT = +%Y-%m-%dT%H:%M:%SZ +SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) +ifdef SOURCE_DATE_EPOCH + BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") +else + BUILD_DATE ?= $(shell date "$(DATE_FMT)") +endif +GIT_TREESTATE = "clean" +DIFF = $(shell git diff --quiet >/dev/null 2>&1; if [ $$? -eq 1 ]; then echo "1"; fi) +ifeq ($(DIFF), 1) + GIT_TREESTATE = "dirty" +endif + +LDFLAGS=-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=$(GIT_VERSION) \ + -X sigs.k8s.io/release-utils/version.gitCommit=$(GIT_HASH) \ + -X sigs.k8s.io/release-utils/version.gitTreeState=$(GIT_TREESTATE) \ + -X sigs.k8s.io/release-utils/version.buildDate=$(BUILD_DATE) + + +##@ Build + +build: ## Build mdtoc + # build local version + go build -trimpath -ldflags "$(LDFLAGS)" -o ./output/mdtoc . + ##@ Verify .PHONY: verify verify-boilerplate verify-dependencies verify-go-mod verify-golangci-lint @@ -58,6 +86,18 @@ update-deps-go: ## Update all golang dependencies for this repo go mod verify $(MAKE) test +## Release + +.PHONY: goreleaser +goreleaser: ## Build zeitgeist binaries with goreleaser + LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \ + goreleaser release --clean + +.PHONY: snapshot +snapshot: ## Build zeitgeist binaries with goreleaser in snapshot mode + LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \ + goreleaser release --clean --snapshot --skip=sign,publish + ##@ Helpers .PHONY: help From 6433718d5fd074c888c2fdc62cdc1cc2526b1efa Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 10:06:23 +0100 Subject: [PATCH 5/6] add templates Signed-off-by: cpanato --- .github/ISSUE_TEMPLATE/bug-report.md | 29 ++++++++++++ .github/ISSUE_TEMPLATE/feature.md | 11 +++++ .github/PULL_REQUEST_TEMPLATE.md | 66 ++++++++++++++++++++++++++++ .github/SECURITY.md | 15 +++++++ 4 files changed, 121 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/feature.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/SECURITY.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..3e69614 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,29 @@ +--- +name: Bug Report +about: Report a bug encountered while using zeitgeist +labels: kind/bug, sig/release, area/release-eng + +--- + + + +#### What happened: + +#### What you expected to happen: + +#### How to reproduce it (as minimally and precisely as possible): + +#### Anything else we need to know?: + +#### Environment: + +- Cloud provider or hardware configuration: +- OS (e.g: `cat /etc/os-release`): +- Kernel (e.g. `uname -a`): +- Others: diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..4091e63 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,11 @@ +--- +name: Feature Request +about: Suggest a feature for zeitgeist +labels: kind/feature, sig/release, area/release-eng + +--- + + +#### What would you like to be added: + +#### Why is this needed: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fa4d2d4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,66 @@ + + +#### What type of PR is this? + + + +#### What this PR does / why we need it: + +#### Which issue(s) this PR fixes: + + + +#### Special notes for your reviewer: + +#### Does this PR introduce a user-facing change? + + + +```release-note + +``` diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..01d7a8f --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported Versions + +Information about supported Kubernetes versions can be found on the +[Kubernetes version and version skew support policy] page on the Kubernetes +website. + +## Reporting a Vulnerability + +Instructions for reporting a vulnerability can be found on the +[Kubernetes Security and Disclosure Information] page. + +[Kubernetes version and version skew support policy]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-versions +[Kubernetes Security and Disclosure Information]: https://kubernetes.io/docs/reference/issues-security/security/#report-a-vulnerability From d3064daa17d6ee6bbcadf050ee8d4d047b6a64fa Mon Sep 17 00:00:00 2001 From: cpanato Date: Thu, 28 Mar 2024 10:23:57 +0100 Subject: [PATCH 6/6] fix lints Signed-off-by: cpanato --- mdtoc.go | 3 +-- mdtoc_test.go | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/mdtoc.go b/mdtoc.go index ac949b1..fce25b5 100644 --- a/mdtoc.go +++ b/mdtoc.go @@ -23,9 +23,8 @@ import ( "log" "os" - "sigs.k8s.io/release-utils/version" - "sigs.k8s.io/mdtoc/pkg/mdtoc" + "sigs.k8s.io/release-utils/version" ) type utilityOptions struct { diff --git a/mdtoc_test.go b/mdtoc_test.go index d5b9c0f..0859a46 100644 --- a/mdtoc_test.go +++ b/mdtoc_test.go @@ -84,7 +84,6 @@ func testdata(subpath string) string { func TestDryRun(t *testing.T) { t.Parallel() for _, test := range testcases { - test := test t.Run(test.file, func(t *testing.T) { t.Parallel() opts := utilityOptions{ @@ -111,7 +110,6 @@ func TestDryRun(t *testing.T) { func TestInplace(t *testing.T) { t.Parallel() for _, test := range testcases { - test := test t.Run(test.file, func(t *testing.T) { t.Parallel() original, err := os.ReadFile(test.file) @@ -157,8 +155,6 @@ func TestInplace(t *testing.T) { func TestOutput(t *testing.T) { t.Parallel() for _, test := range testcases { - test := test - // Ignore the invalid cases, they're only for inplace tests. if !test.validTOCTags { continue