Skip to content

Commit

Permalink
ci: add ossf/scorecard github action
Browse files Browse the repository at this point in the history
Configure Scorecard github action
  • Loading branch information
wwuck committed Mar 10, 2024
1 parent f338d2d commit d089f2d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Scorecards supply-chain security

Check warning on line 1 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

1:1 [document-start] missing document start "---"
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '44 9 * * 4'

Check failure on line 6 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

6:13 [quoted-strings] string value is redundantly quoted with any quotes
push:
branches: [ "master" ]

Check failure on line 8 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:16 [brackets] too many spaces inside brackets

Check failure on line 8 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:17 [quoted-strings] string value is redundantly quoted with any quotes

Check failure on line 8 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:25 [brackets] too many spaces inside brackets

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Used to receive a badge.
id-token: write

steps:
- name: "Checkout code"

Check failure on line 24 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

24:15 [quoted-strings] string value is redundantly quoted with any quotes
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0

Check warning on line 25 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

25:73 [comments] too few spaces before comment
with:
persist-credentials: false

- name: "Run analysis"

Check failure on line 29 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

29:15 [quoted-strings] string value is redundantly quoted with any quotes
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # tag=v2.0.6

Check warning on line 30 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

30:78 [comments] too few spaces before comment
with:
results_file: results.sarif
results_format: sarif

# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"

Check failure on line 43 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

43:15 [quoted-strings] string value is redundantly quoted with any quotes
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0

Check warning on line 44 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

44:80 [comments] too few spaces before comment
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"

Check failure on line 51 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

51:15 [quoted-strings] string value is redundantly quoted with any quotes
uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26

Check warning on line 52 in .github/workflows/scorecards.yml

View workflow job for this annotation

GitHub Actions / yamllint

52:90 [comments] too few spaces before comment
with:
sarif_file: results.sarif
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
![Go Report Card](https://goreportcard.com/badge/github.com/yoheimuta/protolint)](https://goreportcard.com/report/github.com/yoheimuta/protolint)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/yoheimuta/protolint/blob/master/LICENSE)
[![Docker](https://img.shields.io/docker/pulls/yoheimuta/protolint)](https://hub.docker.com/r/yoheimuta/protolint)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/yoheimuta/protolint/badge)](https://api.securityscorecards.dev/projects/github.com/yoheimuta/protolint)

protolint is the pluggable linting/fixing utility for Protocol Buffer files (proto2+proto3):

Expand Down Expand Up @@ -119,7 +120,7 @@ protolint lint -config_path=path/to/your_protolint.yaml . # use path/to/your_pro
protolint lint -config_dir_path=path/to . # search path/to for .protolint.yaml
protolint lint -fix . # automatically fix some of the problems reported by some rules
protolint lint -fix -auto_disable=next . # this is preferable when you want to fix problems while maintaining the compatibility. Automatically fix some problems and insert disable comments to the other problems. The available values are next and this.
protolint lint -auto_disable=next . # automatically insert disable comments to the other problems.
protolint lint -auto_disable=next . # automatically insert disable comments to the other problems.
protolint lint -v . # with verbose output to investigate the parsing error
protolint lint -no-error-on-unmatched-pattern . # exits with success code even if no file is found (file & directory mode)
protolint lint -reporter junit . # output results in JUnit XML format
Expand Down Expand Up @@ -505,7 +506,7 @@ enum Foo {
}
```

Setting the command-line option `-auto_disable` to `next` or `this` inserts disable commands whenever spotting problems.
Setting the command-line option `-auto_disable` to `next` or `this` inserts disable commands whenever spotting problems.

You can specify `-fix` option together. The rules supporting auto_disable suppress the violations instead of fixing them that cause a schema incompatibility.

Expand Down

0 comments on commit d089f2d

Please sign in to comment.