Skip to content

Commit 2045039

Browse files
authored
Merge pull request #45 from smlx/updates
Add OSSF scorecard action and minor README updates
2 parents 2018e1f + b5beabc commit 2045039

File tree

4 files changed

+75
-33
lines changed

4 files changed

+75
-33
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Scorecard analysis workflow
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
analysis:
9+
name: Scorecard analysis
10+
runs-on: ubuntu-latest
11+
permissions:
12+
# Needed if using Code scanning alerts
13+
security-events: write
14+
# Needed for GitHub OIDC token if publish_results is true
15+
id-token: write
16+
17+
steps:
18+
- name: "Checkout code"
19+
uses: actions/checkout@v4
20+
21+
- name: "Run analysis"
22+
uses: ossf/scorecard-action@v2
23+
with:
24+
results_file: results.sarif
25+
results_format: sarif
26+
# Publish the results for public repositories to enable scorecard badges. For more details, see
27+
# https://github.com/ossf/scorecard-action#publishing-results.
28+
# For private repositories, `publish_results` will automatically be set to `false`, regardless
29+
# of the value entered here.
30+
publish_results: true
31+
32+
- name: "Upload SARIF results to code scanning"
33+
uses: github/codeql-action/upload-sarif@v2
34+
with:
35+
sarif_file: results.sarif

README.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,39 @@ It adds basic PR building, dependabot integration, testing, coverage etc.
1313
```bash
1414
git clone git@github.com:smlx/go-cli-github.git $PROJECT_DIR && rm -rf ./$PROJECT_DIR/.git
1515
```
16-
2. Update the `release` workflow branch from `main` to `foo` to disable it, commit all the files, and push to `main` on a new repo.
17-
2. Update for your project, send a PR and merge it once green:
18-
* rename `deploy/go-cli-github` to `deploy/$YOUR_COMMAND`
19-
* update `deploy/$YOUR_COMMAND/Dockerfile`
20-
* rename `cmd/go-cli-github` to `cmd/$YOUR_COMMAND`
21-
* update `.goreleaser.yml` to build `cmd/$YOUR_COMMAND`
22-
* update the links at the top of the README
23-
* update the `build`, `release`, and `tag-to-release` workflows, replacing `go-cli-github` with `$YOUR_COMMAND`.
24-
* update module in `go.mod` and in `cmd/$YOUR_COMMAND/*.go`, `internal/server/serve_test.go`
25-
3. Go to repository Settings > General:
26-
* Disable wiki and projects
27-
* Allow only merge commits for Pull Requests
28-
* Allow auto-merge
29-
* Automatically delete head branches
30-
4. Go to repository Settings > Branches and add branch protection to `main`, and enable:
31-
* Require a PR before merging
32-
* Dismiss stale pull request approvals
33-
* Require status checks to pass before merging
34-
* Require branches to be up-to-date before merging.
35-
* Required status checks:
36-
* CodeQL
37-
* build
38-
* buildimage
39-
* commitlint
40-
* go-test
41-
* lint
42-
* Include administrators
43-
5. Go to repository Settings > Code security and analysis, and enable:
44-
* Dependabot alerts
45-
* Dependabot security updates
46-
6. When ready to release, rename the target branch in the release workflow from `foo` to `main`, and send a PR.
47-
7. That's it.
16+
1. Update the `release` workflow branch from `main` to `foo` to disable it, commit all the files, and push to `main` on a new repo.
17+
1. Update for your project, send a PR and merge it once green:
18+
* rename `deploy/go-cli-github` to `deploy/$YOUR_COMMAND`
19+
* update `deploy/$YOUR_COMMAND/Dockerfile`
20+
* rename `cmd/go-cli-github` to `cmd/$YOUR_COMMAND`
21+
* update `.goreleaser.yml` to build `cmd/$YOUR_COMMAND`
22+
* update the links at the top of the README
23+
* update the `build`, `release`, and `tag-to-release` workflows, replacing `go-cli-github` with `$YOUR_COMMAND`
24+
* update module in `go.mod` and in `cmd/$YOUR_COMMAND/*.go`, `internal/server/serve_test.go`
25+
1. Go to repository Settings > General:
26+
* Disable wiki and projects
27+
* Allow only merge commits for Pull Requests
28+
* Allow auto-merge
29+
* Automatically delete head branches
30+
1. Go to repository Settings > Branches and add branch protection to `main`, and enable:
31+
* Require a PR before merging
32+
* Dismiss stale pull request approvals
33+
* Require status checks to pass before merging
34+
* Require branches to be up-to-date before merging.
35+
* Required status checks:
36+
* CodeQL
37+
* build
38+
* buildimage
39+
* commitlint
40+
* go-test
41+
* lint
42+
* Include administrators
43+
1. Go to repository Settings > Code security and analysis, and enable:
44+
* Dependabot alerts
45+
* Dependabot security updates
46+
* Secret scanning
47+
* Push protection
48+
1. Go to repository Settings > Actions > General:
49+
* Set Workflow permissions to "Read repository contents and package permissions"
50+
1. When ready to release, rename the target branch in the release workflow from `foo` to `main`, and send a PR.
51+
1. That's it.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/smlx/go-cli-github
22

3-
go 1.19
3+
go 1.21
44

55
require github.com/alecthomas/kong v0.8.1

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0=
2+
github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA=
23
github.com/alecthomas/kong v0.8.1 h1:acZdn3m4lLRobeh3Zi2S2EpnXTd1mOL6U7xVml+vfkY=
34
github.com/alecthomas/kong v0.8.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
45
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
6+
github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
57
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
8+
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=

0 commit comments

Comments
 (0)