Skip to content

Commit 38cca23

Browse files
authored
chore: customize the project
* Customize the project template content * Github workflows for: * dependency-review * lint * test * license check * markdown check * ssf scorecard * stale PR * pre-commit-hook * gitleaks * shellcheck * end-of-file-fixer Signed-off-by: Ravi Chamarthy <ravi@chamarthy.dev>
1 parent 8df443b commit 38cca23

16 files changed

+559
-78
lines changed

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
version: 2
218
updates:
319
- package-ecosystem: "github-actions"
@@ -9,3 +25,12 @@ updates:
925
- "github/*"
1026
schedule:
1127
interval: "weekly"
28+
- package-ecosystem: "gomod"
29+
directory: "/"
30+
schedule:
31+
interval: "weekly"
32+
groups:
33+
go-dependencies:
34+
patterns:
35+
- "*"
36+
open-pull-requests-limit: 5
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
# Dependency Review Action
18+
#
19+
# This Action will scan dependency manifest files that change as part of a Pull Request,
20+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
21+
# Once installed, if the workflow run is marked as required,
22+
# PRs introducing known-vulnerable packages will be blocked from merging.
23+
#
24+
# Source repository: https://github.com/actions/dependency-review-action
25+
name: 'Dependency Review'
26+
on: [pull_request]
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
dependency-review:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Harden Runner
36+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
37+
with:
38+
egress-policy: audit
39+
40+
- name: 'Checkout Repository'
41+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
42+
- name: 'Dependency Review'
43+
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1

.github/workflows/license.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: license-check
18+
19+
on:
20+
push:
21+
branches:
22+
# Run on pushes to default branch
23+
- main
24+
# Run against pull requests
25+
pull_request:
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
markdown:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: 🔒 harden runner
35+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
36+
with:
37+
egress-policy: audit
38+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
39+
- name: ⬇️ license checker
40+
run: |
41+
make check-license

.github/workflows/lint.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
name: lint
218

319
on:
@@ -8,6 +24,9 @@ on:
824
# Run against pull requests
925
pull_request:
1026

27+
permissions:
28+
contents: read
29+
1130
jobs:
1231
markdown:
1332
runs-on: ubuntu-latest
@@ -17,8 +36,6 @@ jobs:
1736
with:
1837
egress-policy: audit
1938
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
20-
- name: ⬇️ lint markdown files
21-
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
22-
with:
23-
config: ".markdownlint.json"
24-
args: "**/*.md .github/**/*.md"
39+
- name: ⬇️ lint
40+
run: |
41+
make lint

.github/workflows/markdown.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: markdown-lint
18+
19+
on:
20+
push:
21+
branches:
22+
# Run on pushes to default branch
23+
- main
24+
# Run against pull requests
25+
pull_request:
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
markdown:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: 🔒 harden runner
35+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
36+
with:
37+
egress-policy: audit
38+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
39+
- name: ⬇️ lint markdown files
40+
uses: avto-dev/markdown-lint@04d43ee9191307b50935a753da3b775ab695eceb # v1.5.0
41+
with:
42+
config: ".markdownlint.json"
43+
args: "**/*.md .github/**/*.md"

.github/workflows/scorecard.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
name: scorecard
218

319
on:

.github/workflows/stale.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
name: stale
218

319
on:

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
name: test
18+
19+
on:
20+
push:
21+
branches:
22+
# Run on pushes to default branch
23+
- main
24+
# Run against pull requests
25+
pull_request:
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
markdown:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: 🔒 harden runner
35+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
36+
with:
37+
egress-policy: audit
38+
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
39+
- name: ⬇️ test
40+
run: |
41+
make test

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"default": true,
3+
"MD009": false,
4+
"MD012": false,
35
"MD013": {
46
"line_length": 10000,
57
"headings": false,
@@ -12,5 +14,7 @@
1214
"MD025": {
1315
"front_matter_title": ""
1416
},
17+
"MD031": false,
18+
"MD032": false,
1519
"MD041": false
1620
}

.pre-commit-config.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2024 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
repos:
18+
- repo: https://github.com/gitleaks/gitleaks
19+
rev: v8.16.3
20+
hooks:
21+
- id: gitleaks
22+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
23+
rev: 3.0.0
24+
hooks:
25+
- id: shellcheck
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v4.4.0
28+
hooks:
29+
- id: end-of-file-fixer
30+
- id: trailing-whitespace

0 commit comments

Comments
 (0)